Skip to content

Yash-KK/Django-EC2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploying a Django Application on AWS EC2

Set up an AWS EC2 instance

1. Create an IAM user & login to your AWS Console
  • Access Type - Password
  • Permissions - Admin
2. Create an EC2 instance
  • Select an OS image - Ubuntu
  • Create a new key pair & download .pem file
  1. Connecting to the instance using ssh
ssh -i instance.pem ubunutu@<IP_ADDRESS>

Configuring Ubuntu on remote VM

  1. Updating the outdated packages
sudo apt update

Deploying the project on AWS

  1. Clone the project
  git clone https://github.com/Yash-KK/Django-EC2.git
  cd Django-EC2
  1. Create a virtual enviornment
  virtualenv venv
  source venv/bin/activate
  1. Setup the following enviornment variables
  SECRET_KEY=""
  1. Start the project
  python manage.py runserver 0.0.0.0:8000

NOTE - We will have to edit the inbound rules in the security group of our EC2, in order to allow traffic from our particular port

About

Deploying a Django Application on AWS EC2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published