Version 24 (modified by anonymous, 13 years ago) (diff)

added link to mod_rewrite gotcha

Server arrangements

Because Django uses WSGI, it can run on any WSGI-compatible Web server. Here's how to run Django on various server arrangements.

Apache with mod_python

See the official documentation. you can also look at the django_apache_and_mod_rewrite small tutorial.

Apache with FastCGI

See the official documentation.

Mac OS X users, see Django with FCGI on OS X? -- How to get Django up and running with FastCGI and the Mac OS X default Apache 1.3

Legacy documentation (i.e., unofficial docs written before the official docs were released) is available here: Django, Apache and FCGI and lighttpd+FCGI documentation.

lighttpd with FastCGI

See the official documentation.

Legacy documentation (i.e., unofficial docs written before the official docs were released) is available here: Running Django with FCGI and lighttpd and Django, lighttpd and FCGI, second take.

Django/lighttpd/FastCGI instructions for use on TextDrive shared hosting accounts are also available.

Multiple versions with FastCGI

See MultipleVersionsWithFCGI?


See #172.


See the description in the trac-wiki for how to combine them. TooFPy is a pure-python webserver with focus on the creation of web services.

Apache and SCGI

SCGI can be used with Apache like this. It builds on stuff from the Apache+FCGI documentation above.

Django behind/inside Zope

Not really a server arrangement per se, I've found a way to query a Django site from Zope or Plone and return the result. This allows you to include a Django site inside a pre-existing Zope/Plone site. Good for custom content that you don't want to use existing Zope technologies to develop. For the code, see this partly documented file. It's in a temporary location for the time being; when I get a blog set up, I plan to complete the explanation and post it. For more info, drop an email to jeff (at) bitprophet (dot) org.


Running Django as a traditional CGI is possible and would work the same as running any other sort of Python CGI script, but is generally not recommended.

With traditional CGI, the program which will be run -- in this case, Django plus a Django-powered application -- is loaded from disk into memory each time a request is served, which results in a significant amount of processing overhead and much slower responses. FastCGI and SCGI, in contrast, load the code only once -- when the server starts up -- and keep it in memory as long as the server is running, resulting in much faster responses.

If that hasn't put you off and you still need CGI, take a look at ticket 2407

Django built-in development server

By default the development server that comes with Django will only accept connections on the localhost interface ( To have it listen on the proper network interface, you can start the server like this:

python runserver

Back to Top