Part 2: Administrator’s Guide


This is a work in progress and may have errors.


This guide assumes you are installing the application code into /var/lib/mozbuzz and the public files into /var/www/mozbuzz.


Get the application files into the destination folder by clonning the MozBuzz public Git repository:

$ cd /var/lib
$ git clone

Setting up the execution environment

You will need a Python virtualenv to hold Mozbuzz dependencies:

$ pip install -U virtualenv
$ cd /var/lib/mozbuzz
$ virtualenv .
$ source bin/activate
$ pip install -r requirements.txt

Set up the site

An example setup can be found in Copy that to and customize your settings. Pay special attention to the DATABASES and STATIC_ROOT settings.

Create the application’s database tables by running:

$ python syncdb

Copy the files at public/ to /var/www/mozbuzz and collect the static files:

$ python collectstatic

Set up the webserver

You should refer to your webserver’s documentation to find how to setup the site. We recommend running the site using Nginx and uWSGI.


Create a virtualhost at /etc/nginx/sites-enabled/mozbuzz:

server {
  listen  80;
  access_log /var/log/nginx/;
  error_log /var/log/nginx/;

  location / {
    uwsgi_pass unix:///tmp/;
    include uwsgi_params;

  location /media/ {
    alias /var/www/mozevents/public/media/;

  location /static/ {
    alias /var/www/mozevents/static/;


Create an uWSGI app at /etc/uwsgi/apps-enabled/

vhost = true
plugins = python
socket = /tmp/
master = true
enable-threads = true
processes = 2
wsgi-file = /var/www/mozbuzz/public/
virtualenv = /var/www/mozbuzz/
chdir = /var/www/mozbuzz

Restart the Nginx and uWSGI services and enjoy.


Before an upgrade please test you current setup with the new code. Look at the configuration examples and the documentation to find if you need to update your setup after the upgrade.

Always run database migrations after an upgrade by issuing in a command line:

$ python migrate

Also, make sure your static assets are up to date by running:

$ python collectstatic