Theming best practice: Bootstrap or bare-bones?

74 views
Skip to first unread message

Simon Griffee

unread,
May 27, 2015, 12:16:56 PM5/27/15
to mezzani...@googlegroups.com
I'm beginning work on a Mezzanine theme focussed on blog writing and reading that I want to publish on PyPi.

Mezzanine's templates are currently heavily Bootstrap-dependent and I'm wondering if I should embrace the framework in my theme.

I am leaning toward starting from scratch with simple, minimal HTML and CSS and little-to-no JavaScript, but thought I'd ask here whether this is a fool's errand as I do want to maintain compatibility with future versions of Mezzanine.


Tom Lockhart

unread,
May 27, 2015, 12:40:05 PM5/27/15
to mezzani...@googlegroups.com
You can choose to leave out references to bootstrap in your templates, which will give you “minimal html and css”. But you’ll end up using bootstrap since it is awesome. Build on top of a body of work rather than try to replicate the thousands of hours of work embodied in bootstrap.

hth

- Tom

Simon Griffee

unread,
May 27, 2015, 12:46:34 PM5/27/15
to mezzani...@googlegroups.com
Thanks, Tom.

It does help, and I think you're right!

I'll get to work now.

--
You received this message because you are subscribed to a topic in the Google Groups "Mezzanine Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mezzanine-users/bdqjepkhtzc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mezzanine-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Griffee

unread,
May 27, 2015, 12:47:05 PM5/27/15
to mezzani...@googlegroups.com
Thanks, Tom.

It does help, and I think you're right!

I'll get to work now.

On Wed, May 27, 2015 at 12:39 PM, Tom Lockhart <tlockh...@gmail.com> wrote:

Stephen McDonald

unread,
May 27, 2015, 12:56:18 PM5/27/15
to mezzani...@googlegroups.com
Agree with Tom, use bootstrap if it helps you. 

I just wanted to point out though that nothing in Mezzanine really depends on bootstrap - if you wanted to start from scratch, using an alternative framework or none at all, you certainly can.

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Stephen McDonald
http://jupo.org

Simon Griffee

unread,
May 27, 2015, 1:06:49 PM5/27/15
to mezzani...@googlegroups.com
Thanks, Stephen — understood.

Once I have something to show I'll post a link here.


Gerald Hien

unread,
May 27, 2015, 1:38:21 PM5/27/15
to mezzani...@googlegroups.com, si...@hypertexthero.com
If things don't work as in bootstrap docs, overwrite bootstrap css and js in your projects static folder with current versions, since the ones included in mezzanine are somewhat outdated (3.0.3 fro D

Mathias Ettinger

unread,
May 27, 2015, 5:40:23 PM5/27/15
to mezzani...@googlegroups.com, si...@hypertexthero.com
Just to echo Stephen's words, I built a site removing almost everything theming related. Keeping almost only the magnify-popup javascript. And it works pretty well.

Simon Griffee

unread,
May 29, 2015, 9:22:42 PM5/29/15
to Mathias Ettinger, mezzani...@googlegroups.com
Thanks, Mathias.

I've gone ahead and tried making something *without* using Bootstrap to begin with. If people like this I will make a version that uses Bootstrap, too. My reasoning for this is that I want to :

1. Focus on the simplest code when learning something and…
2. Improve performance by reducing the amount of CSS files, especially as I'm referencing a typeface in the design — I'm a fan of minimalist design :)

Here is version 0.0.1:

https://github.com/hypertexthero/mezzanine-robotonotebook
https://pypi.python.org/pypi/mezzanine-robotonotebook/0.0.1

This was my first time publishing anything on PyPI, and for some reason when I try to `pip install mezzanine-robotonotebook` I get an error message:

Exception:
Traceback (most recent call last):
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/commands/install.py", line 268, in run
    wheel_cache
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/basecommand.py", line 268, in populate_requirement_set
    wheel_cache=wheel_cache
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/req/req_install.py", line 207, in from_line
    wheel_cache=wheel_cache)
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/req/req_install.py", line 66, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2960, in parse
    reqs = list(parse_requirements(s))
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2904, in parse_requirements
    "version spec")
  File "/Users/simon/Projects/mezt-env/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2869, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'mezzanine-robotonotebook=0.0.1', 'at', '=0.0.1')

Any advice on this?

Graham

unread,
May 29, 2015, 10:33:49 PM5/29/15
to mezzani...@googlegroups.com
Hi Simon
If I do pip install mezzanine-robotonotebook
Below is the stack trace
It is looking for something at https://pypi.python.org/simple/mezzanine-robotonotebook/
like what you may find here for example https://pypi.python.org/simple/mezzanine/

I am not sure if that is related to the error you are getting...
g

------------------------------------------------------------
/home/graham/Virtual-Environments/throwaway/bin/pip run on Sat May 30 14:22:48 2015
Downloading/unpacking mezzanine-robotonotebook
  Getting page https://pypi.python.org/simple/mezzanine-robotonotebook/
  URLs to search for versions for mezzanine-robotonotebook:
  * https://pypi.python.org/simple/mezzanine-robotonotebook/
  Analyzing links from page https://pypi.python.org/simple/mezzanine-robotonotebook/
  Could not find any downloads that satisfy the requirement mezzanine-robotonotebook
Cleaning up...
  Removing temporary dir /home/graham/Virtual-Environments/throwaway/build...
No distributions at all found for mezzanine-robotonotebook
Exception information:

Traceback (most recent call last):
  File "/home/graham/Virtual-Environments/throwaway/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/home/graham/Virtual-Environments/throwaway/local/lib/python2.7/site-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/home/graham/Virtual-Environments/throwaway/local/lib/python2.7/site-packages/pip/req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/home/graham/Virtual-Environments/throwaway/local/lib/python2.7/site-packages/pip/index.py", line 277, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for mezzanine-robotonotebook
-- 
T : 021 081 71732

Graham

unread,
May 29, 2015, 10:59:35 PM5/29/15
to mezzani...@googlegroups.com
Hi Simon
I have had a look at this blog post http://peterdowns.com/posts/first-time-with-pypi.html
It says that you need a setup.py file which I am not seeing on your repo...

cheers
g


On 30/05/15 13:22, Simon Griffee wrote:
-- 
T : 021 081 71732

Simon Griffee

unread,
May 29, 2015, 11:26:08 PM5/29/15
to mezzani...@googlegroups.com
Hi Graham,

Those are the instructions I followed, and they seem to have worked —
my package is listed on PyPI and from what I can see the `setup.py`
file should be inside the same folder containing the package, and not
in the package itself.

This brings up the question of whether there is a 'best practice' for
packaging Django apps in development (I'm a novice). My current
foldersetup is as follows:

mezzanine-roboto-notebook-env <--- My virtualenv
├── bin
├── include
├── lib
├── mezzanine-roboto-notebook
│ ├── ...
│ ├── robotonotebook <--- THE git repo which I develop on and
push to https://github.com/hypertexthero/mezzanine-robotonotebook
│ │ ├── LICENSE.txt
│ │ ├── README.md
│ │ ├── __init__.py
│ │ ├── static
│ │ └── templates
│ ├── ...
├── package <--- THE package pushed to PyPI using the
instructions you mentioned
│ ├── LICENSE.txt
│ ├── README.md
│ ├── robotonotebook
│ │ ├── __init__.py
│ │ ├── static
│ │ └── templates
│ ├── setup.cfg
│ └── setup.py
└── pip-selfcheck.json

I'm going to get some sleep now — back sometime tomorrow!

Simon



Simon Griffee
www.hypertexthero.com

Stephen McDonald

unread,
May 30, 2015, 2:27:39 AM5/30/15
to mezzani...@googlegroups.com
I'd suggest finding some open source Django apps and studying their structure on Github. Also following the tutorial you linked to before more closely, you've steered away from it it seems.

- The virtualenv directory isn't relevant
- You've split out a "package" directory and the git repo, with duplicate content, these should be the same thing, including setup.py etc
- Once you've got everything on Github, people can then at least see your setup.py and look to see if it has problems, at the moment it's hidden on your computer
- At a guess, the project's showing up on PyPI as you did the "register" step, but possibly you forgot the "upload" step.


Stephen McDonald

unread,
May 30, 2015, 2:32:09 AM5/30/15
to mezzani...@googlegroups.com
You've also got files in there that shouldn't be in the repo: https://github.com/hypertexthero/mezzanine-robotonotebook/blob/master/templates/.DS_Store

That tutorial doesn't seem to deal with including non-Python files in your package, which you'll need to do to include your templates and other static files. I can't do a proper tutorial justice by trying to document the steps here, but these are normally handled by a MANIFEST file, look at Mezzanine's for example: https://github.com/stephenmcd/mezzanine/blob/master/MANIFEST.in

Your setup.py should include references to necessary dependencies - again, no way of telling without seeing it, but since you describing installing them manually in the readme file, presumably this step has been omitted too.

Stephen McDonald

unread,
May 30, 2015, 2:39:19 AM5/30/15
to mezzani...@googlegroups.com
BTW don't feel disheartened, I never found a complete and thorough tutorial documenting this either (that's not to say there isn't one). The official docs are incredibly dense too. I just worked it all out through trial and error. 

The good thing is that once you get everything working, you never really need to go through it again. I just copy and paste from one project to the next.

Simon Griffee

unread,
May 30, 2015, 9:52:25 AM5/30/15
to mezzani...@googlegroups.com
Thanks, Stephen.

I'll go through it again and keep at it. Once I get it all working
I'll document the steps I took here.
Simon Griffee
www.hypertexthero.com

Graham Oliver

unread,
Jun 3, 2015, 3:33:52 AM6/3/15
to mezzani...@googlegroups.com, si...@hypertexthero.com
Hi Simon
I did pip install robotonotebook
and all was good, looks really good so far :-)
Cheers
g

Simon Griffee

unread,
Jun 3, 2015, 11:35:48 AM6/3/15
to mezzani...@googlegroups.com
Hi Graham,

Thanks! I'm still sorting out the packaging stuff and some design
issues and will comment here once I get a little further.

Simon Griffee
www.hypertexthero.com
Reply all
Reply to author
Forward
0 new messages