Integration

We also provide integration for both Django and Paster applications.

Django

Gunicorn will look for a WSGI callable named application if not specified. So for a typical Django project, invoking Gunicorn would look like:

  1. $ gunicorn myproject.wsgi

Note

This requires that your project be on the Python path; the simplest way to ensure that is to run this command from the same directory as your manage.py file.

You can use the –env option to set the path to load the settings. In case you need it you can also add your application path to PYTHONPATH using the –pythonpath option:

  1. $ gunicorn --env DJANGO_SETTINGS_MODULE=myproject.settings myproject.wsgi

Paste

If you are a user/developer of a paste-compatible framework/app (as Pyramid, Pylons and Turbogears) you can use the –paste option to run your application.

For example:

  1. $ gunicorn --paste development.ini -b :8080 --chdir /path/to/project

Or use a different application:

  1. $ gunicorn --paste development.ini#admin -b :8080 --chdir /path/to/project

It is all here. No configuration files nor additional Python modules to write!