abidibo.net

Posted in "wsgi"

Deploy django applications with nginx, uwsgi, virtualenv, south, git and fabric, part 3

deploy django nginx programming wsgi

This is the third part of the django deploy environment, you may find the second part here.

In this part we'll see how to set up nginx and uwsgi to work with our django project.

Let's install and configure uwsgi

Be sure to have the virtualenv activated (see part 2), and then install uwsgi

$ pip install uwsgi

Ok now we have to configure our project to work with uwsgi, open and edit the myproject/myproject/wsgi.py file, mine looks like this:

"""
WSGI config for sic2012 project.

This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.

Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.

"""
import os ...

read the full post


  • 1

Your Smartwatch Loves Tasker!

Your Smartwatch Loves Tasker!

Now available for purchase!

Featured