gunicorn.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 file containing a WSGI application object named
  18. `application`. So for a typical Django project, invoking gunicorn would look
  19. like::
  20. gunicorn myproject.wsgi
  21. This will start one process running one thread listening on ``127.0.0.1:8000``.
  22. It requires that your project be on the Python path; the simplest way to ensure
  23. that is to run this command from the same directory as your ``manage.py`` file.
  24. See Gunicorn's `deployment documentation`_ for additional tips.
  25. .. _deployment documentation: http://docs.gunicorn.org/en/latest/deploy.html