gunicorn.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ===============================
  2. How to use Django with Gunicorn
  3. ===============================
  4. Gunicorn_ ('Green Unicorn') is a pure-Python WSGI server for UNIX. It has no
  5. dependencies and can be installed using ``pip``.
  6. .. _Gunicorn: https://gunicorn.org/
  7. Installing Gunicorn
  8. ===================
  9. Install gunicorn by running ``python -m pip install gunicorn``. For more
  10. details, see the `gunicorn documentation`_.
  11. .. _gunicorn documentation: https://docs.gunicorn.org/en/latest/install.html
  12. Running Django in Gunicorn as a generic WSGI application
  13. ========================================================
  14. When Gunicorn is installed, a ``gunicorn`` command is available which starts
  15. the Gunicorn server process. The simplest invocation of gunicorn is to pass the
  16. location of a module containing a WSGI application object named
  17. ``application``, which for a typical Django project would look like:
  18. .. code-block:: shell
  19. gunicorn myproject.wsgi
  20. This will start one process running one thread listening on ``127.0.0.1:8000``.
  21. It requires that your project be on the Python path; the simplest way to ensure
  22. that is to run this command from the same directory as your ``manage.py`` file.
  23. See Gunicorn's `deployment documentation`_ for additional tips.
  24. .. _deployment documentation: https://docs.gunicorn.org/en/latest/deploy.html