gunicorn.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ===============================
  2. How to use Django with Gunicorn
  3. ===============================
  4. .. highlight:: bash
  5. Gunicorn_ ('Green Unicorn') is a pure-Python WSGI server for UNIX. It has no
  6. dependencies and is easy to install and use.
  7. .. _Gunicorn: http://gunicorn.org/
  8. Installing Gunicorn
  9. ===================
  10. Installing gunicorn is as easy as ``sudo pip install gunicorn``. For more
  11. details, see the `gunicorn documentation`_.
  12. .. _gunicorn documentation: http://docs.gunicorn.org/en/latest/install.html
  13. Running Django in Gunicorn as a generic WSGI application
  14. ========================================================
  15. When Gunicorn is installed, a ``gunicorn`` command is available which starts
  16. the Gunicorn server process. At its simplest, gunicorn just needs to be called
  17. with the location of a WSGI application object.::
  18. gunicorn [OPTIONS] APP_MODULE
  19. Where ``APP_MODULE`` is of the pattern ``MODULE_NAME:VARIABLE_NAME``. The
  20. module name should be a full dotted path. The variable name refers to a WSGI
  21. callable that should be found in the specified module.
  22. So for a typical Django project, invoking gunicorn would look like::
  23. gunicorn myproject.wsgi:application
  24. (This requires that your project be on the Python path; the simplest way to
  25. ensure that is to run this command from the same directory as your
  26. ``manage.py`` file.)
  27. See Gunicorn's `deployment documentation`_ for additional tips.
  28. .. _deployment documentation: http://docs.gunicorn.org/en/latest/deploy.html