gunicorn.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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 can be installed using ``pip``.
  7. .. _Gunicorn: https://gunicorn.org/
  8. Installing Gunicorn
  9. ===================
  10. Install gunicorn by running ``python -m pip install gunicorn``. For more
  11. details, see the `gunicorn documentation`_.
  12. .. _gunicorn documentation: https://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. The simplest invocation of gunicorn is to pass the
  17. location of a module containing a WSGI application object named
  18. ``application``, which for a typical Django project would look like::
  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