2021-07-30 01:11:42 +08:00
|
|
|
====================
|
|
|
|
How to deploy Django
|
|
|
|
====================
|
2008-08-24 06:25:40 +08:00
|
|
|
|
2021-07-23 14:48:16 +08:00
|
|
|
Django is full of shortcuts to make web developers' lives easier, but all
|
2008-08-24 06:25:40 +08:00
|
|
|
those tools are of no use if you can't easily deploy your sites. Since Django's
|
2015-06-05 16:36:42 +08:00
|
|
|
inception, ease of deployment has been a major goal.
|
2008-08-24 06:25:40 +08:00
|
|
|
|
2019-09-12 13:44:37 +08:00
|
|
|
There are many options for deploying your Django application, based on your
|
|
|
|
architecture or your particular business needs, but that discussion is outside
|
|
|
|
the scope of what Django can give you as guidance.
|
2019-04-12 21:15:18 +08:00
|
|
|
|
2019-09-12 13:44:37 +08:00
|
|
|
Django, being a web framework, needs a web server in order to operate. And
|
|
|
|
since most web servers don't natively speak Python, we need an interface to
|
|
|
|
make that communication happen.
|
|
|
|
|
|
|
|
Django currently supports two interfaces: WSGI and ASGI.
|
|
|
|
|
2021-07-23 14:48:16 +08:00
|
|
|
* `WSGI`_ is the main Python standard for communicating between web servers and
|
2019-09-12 13:44:37 +08:00
|
|
|
applications, but it only supports synchronous code.
|
|
|
|
|
|
|
|
* `ASGI`_ is the new, asynchronous-friendly standard that will allow your
|
|
|
|
Django site to use asynchronous Python features, and asynchronous Django
|
|
|
|
features as they are developed.
|
|
|
|
|
|
|
|
You should also consider how you will handle :doc:`static files
|
|
|
|
</howto/static-files/deployment>` for your application, and how to handle
|
|
|
|
:doc:`error reporting</howto/error-reporting>`.
|
|
|
|
|
|
|
|
Finally, before you deploy your application to production, you should run
|
|
|
|
through our :doc:`deployment checklist<checklist>` to ensure that your
|
|
|
|
configurations are suitable.
|
|
|
|
|
|
|
|
.. _WSGI: https://wsgi.readthedocs.io/en/latest/
|
|
|
|
.. _ASGI: https://asgi.readthedocs.io/en/latest/
|
2019-04-12 21:15:18 +08:00
|
|
|
|
2008-08-24 06:25:40 +08:00
|
|
|
.. toctree::
|
2019-09-09 16:02:33 +08:00
|
|
|
:maxdepth: 2
|
2010-08-20 03:27:44 +08:00
|
|
|
|
2011-10-22 12:30:10 +08:00
|
|
|
wsgi/index
|
2019-04-12 21:15:18 +08:00
|
|
|
asgi/index
|
2013-03-18 01:21:05 +08:00
|
|
|
checklist
|