index.txt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ====================
  2. How to deploy Django
  3. ====================
  4. Django is full of shortcuts to make web developers' lives easier, but all
  5. those tools are of no use if you can't easily deploy your sites. Since Django's
  6. inception, ease of deployment has been a major goal.
  7. There are many options for deploying your Django application, based on your
  8. architecture or your particular business needs, but that discussion is outside
  9. the scope of what Django can give you as guidance.
  10. Django, being a web framework, needs a web server in order to operate. And
  11. since most web servers don't natively speak Python, we need an interface to
  12. make that communication happen. The :djadmin:`runserver` command starts a
  13. lightweight development server, which is not suitable for production.
  14. Django currently supports two interfaces: WSGI and ASGI.
  15. * `WSGI`_ is the main Python standard for communicating between web servers and
  16. applications, but it only supports synchronous code.
  17. * `ASGI`_ is the new, asynchronous-friendly standard that will allow your
  18. Django site to use asynchronous Python features, and asynchronous Django
  19. features as they are developed.
  20. You should also consider how you will handle :doc:`static files
  21. </howto/static-files/deployment>` for your application, and how to handle
  22. :doc:`error reporting</howto/error-reporting>`.
  23. Finally, before you deploy your application to production, you should run
  24. through our :doc:`deployment checklist<checklist>` to ensure that your
  25. configurations are suitable.
  26. .. _WSGI: https://wsgi.readthedocs.io/en/latest/
  27. .. _ASGI: https://asgi.readthedocs.io/en/latest/
  28. .. toctree::
  29. :maxdepth: 2
  30. wsgi/index
  31. asgi/index
  32. checklist