Django App Deployment
Steps to Deploy Django
Update the repository
sudo apt updateInstall the required packages
sudo apt install nginx
sudo apt install python3-pip
sudo pip3 install gunicorn
sudo apt install certbot
sudo apt install python3-certbot-nginxClone your Django project on EC2 instance and install its dependencies:
git clone https://github.com/<username>/<project-name>.git
cd <project-name>
pip3 install -r requirements.txtConfigure Gunicorn to run your Django application:
cd <project-folder>
gunicorn --workers 3 --bind unix:/tmp/gunicorn.sock <project-name>.wsgi:applicationCreate Nginx server block to proxy requests to Gunicorn:
Last updated
Was this helpful?