Learn How to Deploy a Django Application

In this post, we'll go over the steps to deploy a Django application on a production server. I am using an AWS ec2 server, an Ubuntu 20.04 instance, and Python 3.8. The steps are the same for most versions of Ubuntu and Python, however, the syntax might differ based on the version you are using.

Steps

  1. Install Apache2.
  2. List out the project's folder and file's path.
  3. Collect static files.
  4. Migrate the database.
  5. Change the permission and ownership of the database files and other folders.
  6. Make changes in the Apache config file.
  7. Enable the site.
  8. Install WSGI mod in Apache2.
  9. Restart the Apache Server.

Step 1: Install Apache 2

 The following are the commands to install the Apache 2 server on the Ubuntu instance.