Here we are going to learn how to deploy Django application in AWS cloud. We are using NGINX as web server and Gunicorn as WSGI Interface between NGINX and Django. We are hosting django application in Ubuntu Linux VM (EC2 instance) in amazon web service.
To deploy, we have already created a django application. The source code for the same is provided in github.
Youtube tutorial :
Github code :
In this tutorial we are performing below steps to deploy python django application to aws cloud:
1. Login to aws console.
2. Launch a server instance in aws . We launch a ubuntu instance
3. SSH to remote server in aws cloud. IF you are using widows use tool like PuTTy or gitbash terminal to ssh to aws server instances.
4. Install NGINX server in Ubuntu and starting it.
5. Security Setting in aws to allow traffic to nginx server
6. Install PIP (python package manager). Use the command “sudo apt install python3-pip” to install pip in linux VM.
7. Install virtualenv. Use the command “sudo apt install python3-virtualenv” to install virtual env in linux vm.
6. Create vitualenv . To Create virtualenv use command “virtualenv venv”. venv is the folder name
7. Clone Django project source code from git repository.
8. Install required packages in virtualenv.
9. Install Gunicorn server.
10. Starting Gunicorn server.
11. Configure nginx to connect to Gunicorn
Thank for reading. If you find the useful please subscribe my channel and share with others who likes this.