Setting up Django with NGINX
Django rose to fame when a small US newspaper firm open sourced their application back in 2005. From there, Django has grown into the most widely used Python-based web framework. Still used by companies such as Instagram and Pinterest, the relevancy of Django is still as strong as ever.

Getting ready
Django interfaces to NGINX through a Web Server Gateway Interface (WSGI). For Django, one of the most commonly used WSGI interfaces is uWSGI.
If you haven't installed uWSGI yet, the best way is to install the latest version via pip
:
apt-get install python-pip python-dev pip install uwsgi
We're going to simply use a base install of the latest version of Django, which at the time of writing this book was 1.10.5.

How to do it...
We'll now configure uWSGI to point to our Django project, which for this example I have located at /var/www/djangodemo
. Here's the uwsgi.ini
file:
[uwsgi] socket = 127.0.0.1:8000 uid=www-data gid=www-data chdir=/var/www/djangodemo module=djangodemo...