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/.
Using uWSGI
Throughout this book, you have been using the Django development server to run projects in your local environment. However, you need a standard web server for deploying your application in a production environment.
uWSGI is an extremely fast Python application server. It communicates with your Python...