How do I deploy my Mezzanine site?

Posted December 22, 2014 7.3k views

I have a working blog site running on Mezzanine in the development server.

I’ve been attempting to piece together how I switch this to an nginx/gunicorn, but there doesn’t seem to be a complete tutorial for this.

If there is a tutorial that explains how to deploy a Mezzanine site using the one-click Django droplet, that would also be fine. As it is, I’m attempting to set it up on an Ubuntu server.

This tutorial purports to explain the process, but has some serious gaps:

For starters, it does not touch installing the Database backend, or configuring it in the Django app. I “solved” this by using sqlite, but that is not a workable production solution, as I understand it.

Further, the tutorial only takes you as far as setting up the dev server.

It then passes you off to this document:

…which contains a “Hello World,” but does not explain how to deploy a Mezzanine/Django site on DigitalOcean, which is currently what I’m trying to do.

Can someone help with this? I’m at

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Mezzanine projects should come with a that will automate setting up a stanadrd Nginx/Gunicorn/Postgres stack using using Fabric. Check out the Mezzanine docs.

You’ll need to add some server specific configurable variables in the project’s module. Here’s an example:

    "SSH_USER": "", # SSH username for host deploying to
    "HOSTS": ALLOWED_HOSTS[:1], # List of hosts to deploy to (eg, first host)
    "DOMAINS": ALLOWED_HOSTS, # Domains for public site
    "REPO_URL": "ssh://", # Project's repo URL
    "VIRTUALENV_HOME":  "", # Absolute remote path for virtualenvs
    "PROJECT_NAME": "", # Unique identifier for project
    "REQUIREMENTS_PATH": "requirements.txt", # Project's pip requirements
    "GUNICORN_PORT": 8000, # Port gunicorn will listen on
    "LOCALE": "en_US.UTF-8", # Should end with ".UTF-8"
    "DB_PASS": "", # Live database password
    "ADMIN_PASS": "", # Live admin user password
  • I’m also stuck here–

    1. I can prepare a droplet (Ubuntu) for python apps,
    2. I can create a virtual env, install and create a mezzanine project, and successfully start the test server,
    3. But I cannot deploy, using fabric or anything else so far (I’ve tried everything here)

    I’m not sure what I might be doing wrong, but I’ve tried configuring and using fabric every which way. Some example questions I could ask are below, but I for one would LOVE a mezzanine-ready image for a new droplet! This would be a real asset.

    – to run fabric commands, a is required, right? So we need to mezzanine-project before running fab?
    – if so, how is “fab all” properly used? “fab deploy” is also wanting to create a mezzanine folder in my home/user folder (maybe this is normal…). However, in that mezzanine folder, I keep getting errors when trying to run “fab all” or “fab deploy” no matter where I start from. Sometimes it’s a missing file, sometimes a “project already exists” or it tries to create a “user” with my project name, sometimes other things…

    Any ideas? Thanks so much!