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