DEV Community

sadasdkjoiwck
sadasdkjoiwck

Posted on

1

Django on AMI

If you're using AMI then there are few things to take note before proceeding.

  • AMI have yum as package manager.
  • AMI Linux 2 has amazon-linux-extras which are available as topics

Setup the environment

sudo yum update -y

sudo yum install gcc

cat /var/run/yum.pid

ps -p 3633

ps -ef | grep 3633

kill -9 3633

sudo amazon-linux-extras install python3

curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
python3 -m pip install --upgrade pip

yum search pip
sudo yum install python3-pip

python3 -m venv /path/to/new/virtual/environment

sudo pip3 install virtualenv

sudo amazon-linux-extras install nginx1

mkdir project-name
cd project-name

virtualenv env
. env/bin/activate

pip3 install django

pip3 install uwsgi

django-admin --version

uwsgi --socket /opt/uwsgi/sock/yt_demo.sock --wsgi-file /home/ec2-user/project/testsite/testsite/wsgi.py

Enter fullscreen mode Exit fullscreen mode

Note: I have taken help from multiple source and prepared this article. And all source deserves to receive the credits.

Credits,

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs