Hosting Django application in AWS cloud with NGINX web server  and Gunicorn WSGI Server.

Hosting Django application in AWS cloud with NGINX web server and Gunicorn WSGI Server.

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.

16 thoughts on “Hosting Django application in AWS cloud with NGINX web server and Gunicorn WSGI Server.

  1. Thank you very much sir for providing this video, this was very helpful content for us, all the things have gone very nice till last, Sir will you please tell me why static files are not loading at the end of the process.

  2. thank you and i have a question. when i install ubuntu, there is python version of 3.8. but in my computer, python is 3.7. how can I downgrade the python 3.8 in ubuntu to python 3.7 ? is it possible?

  3. Nice tutorial that explain each step of deployment of python Django project in aws. I could deploy project in aws. Thanks 👍

  4. Easy and simple steps, each step works perfectly. Well explained concepts. Successfully followed and implemented all the steps 😊. Thank you for the awesome video.

  5. Hello sir, I hv deployed a django application in aws using the t2.micro free tire instance.. Everything working fine except the images.. what would be the problem ? Please help..

Leave a Reply

Your email address will not be published. Required fields are marked *