
This will install pip, the Python development files needed to build Gunicorn later, the Postgres database system and the libraries needed to interact with it, and the Nginx web server.


Step 1 - Installing the Packages from the Debian Repositories We will then set up Nginx in front of Gunicorn to take advantage of its high performance connection handling mechanisms and its easy-to-implement security features. This will serve as an interface to our application, translating client requests from HTTP to Python calls that our application can process. Once we have our database and application up and running, we will install and configure the Gunicorn application server. Installing Django into an environment specific to your project will allow your projects and their requirements to be handled separately. We will be installing Django within a virtual environment. You can learn how to set this up by running through our initial server setup guide. In order to complete this guide, you should have a fresh Debian 9 server instance with a basic firewall and a non-root user with sudo privileges configured. We will then set up Nginx to reverse proxy to Gunicorn, giving us access to its security and performance features to serve our apps.

We will configure the Gunicorn application server to interface with our applications. We will be setting up a PostgreSQL database instead of using the default SQLite database.

In this guide, we will demonstrate how to install and configure some components on Debian 9 to support and serve Django applications. Django includes a simplified development server for testing your code locally, but for anything even slightly production related, a more secure and powerful web server is required. Django is a powerful web framework that can help you get your Python application or website off the ground.
