Serving Django through WSGI and NGINX
Django’s primary deployment platform is WSGI. WSGI stands for Web Server Gateway Interface , and it is the standard for serving Python applications on the web.
When you generate a new project using the startproject
command, Django creates a wsgi.py
file inside your project directory. This file contains a WSGI application callable, which is an access point to your application.
WSGI is used for both running your project with the Django development server and deploying your application with the server of your choice in a production environment. You can learn more about WSGI at https://wsgi.readthedocs.io/en/latest/.
In the following sections we will use uWSGI, an open source web server that implements the WSGI specification.
Using uWSGI
Throughout this book, you have been using the Django development server to run projects in your local environment. However, the development server is not designed for production use, and...