Zamboni in Production

Getting Requirements

Grab zamboni from github with

git clone git://
git submodule update --init

You’re going to need virtualenv and pip, but I’ll let you figure that one out.

We rely on one compiled package, MySQLdb. It needs to link against the mysql-dev headers, so install that one system-wide. The rest of our packages should be installed in a virtualenv using pip. If you’re oremj, do this:

pip install

Otherwise, get them from the internet like this:

pip install -r requirements-prod.txt


We keep most of our config in under version control. Local config can be overridden in This template, inlined below, can be found at docs/settings/

from settings import *

DEBUG = False

# The default database should point to the master.
    'default': {
        'NAME': 'zamboni',
        'ENGINE': 'django.db.backends.mysql',
        'HOST': '',
        'PORT': '',
        'USER': '',
        'PASSWORD': '',
        'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
    'slave': {
        'NAME': 'zamboni',
        'ENGINE': 'django.db.backends.mysql',
        'HOST': '',
        'PORT': '',
        'USER': '',
        'PASSWORD': '',
        'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},

# Put the aliases for slave databases in this list.

# Use IP:PORT pairs separated by semicolons.
CACHE_BACKEND = 'django_pylibmc.memcached://localhost:11211;localhost:11212?timeout=500'

# This is used to hash some things in Django.
SECRET_KEY = 'replace me with something long'

# Remove any apps that are only needed for development.
INSTALLED_APPS = tuple(app for app in INSTALLED_APPS if app not in DEV_APPS)



Setting up mod_wsgi

Here’s a basic httpd.conf snippet that I used to get zamboni running on my Mac:

LoadModule wsgi_module modules/
WSGIPythonHome /Users/jeff/.virtualenvs/baseline

# TODO: /media and /admin-media

<VirtualHost *:80>  #*
    WSGIScriptAlias / /Users/jeff/dev/zamboni/wsgi/zamboni.wsgi

    WSGIDaemonProcess zamboni processes=8 threads=1 \
    WSGIProcessGroup zamboni

    <Directory /Users/jeff/dev/zamboni/wsgi>
        Order allow,deny
        Allow from all

WSGIPythonHome points at a pristine virtual environment. That came from

WSGIScriptAlias points to /wsgi/zamboni.wsgi in the zamboni checkout.

WSGIDaemonProcess creates 8 processes and 10 threads. Those numbers are completely arbitrary. I’ll update it when we know what works in production. The python-path argument points to the site-packages directory of our zamboni virtualenv.


This doesn’t include media or admin media yet.

Table Of Contents

Previous topic

Packaging in Zamboni

Next topic

Search (powered by SphinxSearch)

This Page