How to Install Multiple Django Sites on the Same Server

By Rich Jones
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!


Best Sites to Find Clients as a Freelance Developer

Fill your pipeline with best-fit clients for your rate, engagement length, and role preferences.

Take The Quiz



See More Posts About:


Posted by Rich Jones

LinkedIn Website