[Fixed]-How do I install Mezzanine as a Django app?


If you are like me, you will find that the FAQ is sorely lacking in its description of how to get Mezzanine working as an app. So here is what I did (after a painful half day of hacking) to get it integrated (somewhat):

  1. Download the repo and copy it into your project
  2. Run setup.py for the package
  3. cd to the package and run the mezzanine command to create a new app (mezzanine-project <project name>), let’s say you use the name blog as your <project_name>.
  4. In either the local_settings.py or settings.py file, set the DATABASES dict to use your project’s database.
  5. Run the createdb command from the mezzanine manage.py file

Now it’s time to start the hack-fest:

  1. In your project’s settings.py file, add blog to INSTALLED_APPS
  2. Add some configuration variables to settings.py that Mezzanine is expecting:

    PACKAGE_NAME_FILEBROWSER = "filebrowser_safe"
    PACKAGE_NAME_GRAPPELLI = "grappelli_safe"
    RATINGS_RANGE = range(1, 5)
    TESTING = False
    BLOG_SLUG = ''
  3. Add some middleware that Mezzanine is expecting:

    Uncomment the following if using any of the SSL settings:



  4. Add some INSTALLED_APPS that Mezzanine is expecting:

  5. Add references to the template folders of mezzanine to your TEMPLATE_DIRS tuple

    os.path.join(BASE_PARENT, '<path to mezzanine>/mezzanine/mezzanine'),
    os.path.join(BASE_PARENT, '<path to mezzanine>/mezzanine/mezzanine/blog/templates'),
  6. Finally, if your like me, you’ll have to override some of the extends paths in the mezzanine templates, the most obvious being in “blog_post_list.html” which just extends base.html, instead you want it to extend the mezzanine specific base file. So go to that file and replace the {% extends "base.html" %} with {% extends "core/templates/base.html" %}.


This is covered in the FAQs:


TLDR: Mezzanine adds a handful of settings, apps, middleware and context processors, all defined in its default settings.py file – you just need to extract enough of those, depending on your needs.


Leave a comment