How to Install Multiple Django Sites on the Same Server

by Rich Jones on Sep 5, 2011.
The theme music to this blog post is Against Me! - Unprotected Sex With Multiple Partners.

This is going to be a short and technical post about deploying two or more Django applications on the same server, so that '' and '' access two different Django projects.

This assumes that you are using Apache and mod_wsgi to deploy your Django applications. The best guide I've found for doing that is here at

The basic concept is really simple here, you just need to register a different WSGIScriptAlias for each project you're hosting in your sites-available file.

So, your set up might look something like this:

    WSGIScriptAlias /app2 /var/www/app2/app2/django.wsgi
    <Directory /var/www/app2/app2>
        Order allow,deny
        Allow from all

    WSGIScriptAlias / /var/www/app1/app1/django.wsgi
    <Directory /var/www/app1/app1>
        Order allow,deny
        Allow from all

This would make call app2 and call app1. It's important that you put the project which has the suffix BEFORE the one which doesn't, or it else it won't work. Then just call sudo service apache2 restart and test it out. Hopes this helps!

Learn and Earn!

Sign up for great tutorials, guides, rants, raves and opportunities to earn more money!