Django in Production - From Zero to Hero

Learn how to deploy django application on single host. In this course we will start with a bare metal VPS machine and complete with a full fledged Django application in production mode. I will guide you, step by step, through the most important steps of moving to production.

This course focuses on the process in general and does not deal with specifics of the application. If you have a basic application (static files are part of django application) and running application on your own server is what you are looking for then this course is for you!

GitHub Repo with ansible playbook used in this course.

  • #1 Setup the Remote Host

    Let's prepare the remote host first. When you start with a new server, you need to create a non-root user account, setup hostname and most importantly take care of ssh access.

  • #2 Install and Configure Nginx

    Next we focus on webserver. For this course I chose nginx as webserver. In this part of the course I will explain where nginx fits in whole production picture and how it relates to django application in general.

  • #3 Automation with Ansible

    Ansible is a fantastic tool to have in your arsenal, it is practical, simple to use and a huge time saver. In this part of the course I introduce you to main concepts of this awesome tool. Don't skip it.

  • #4 Database

    PostgreSQL - is the database of choice for this course. PostgreSQL is an extremely powerful database. The best part is that it is easy to setup and in this episode I will show you how.

  • #5 The Heart of it - Gunicorn + Django!

    Gunicorn + Django + Nginx is the killer combo for production environment. It is extremely important to understand how they interact and how they relate to each other. In just 12 minutes you will learn the core of any production environment.

  • #6 Ansible Roles for Gunicorn and Application

    In this unit we complete our ansible playbook. We will add two more ansible roles: one for gunicorn and one for django application. Here I assume that you completed previous lesson so that I will skip gunicorn details and I will focus only on ansible related material.

  • #7 HTTPS

    Without HTTPS (secured http) your application is not production ready. In this lesson you will learn how to secure your web application with certbot (Let's Encrypt Client)