Ensure the EC2 Instance Allows Traffic
Launch a Docker Container and Update
- docker run -it -p 80:80 ubuntu /bin/bash
- apt-get update
- apt-get upgrade
- apt-get dist-upgrade
Install Python 2.7, Pip, Amazon Command Line Interface (AWS CLI) and
- apt-get install python2.7
- apt-get install curl
- curl -O https://bootstrap.pypa.io/get-pip.py
- python2.7 get-pip.py
- apt-get install python-cryptography
- pip isntall aws
- pip install –upgrade –user awsebcli
- PATH=$PATH:~/.local/bin; export PATH
Install and Create Virtualenv
- pip install virtualenv
- ~/eb-virt
- virtualenv ~/eb-virt
- source ~/eb-virt/bin/activate
Install Django
- pip install django==1.9.2
Start a Django Project
- django-admin startproject ebdjango
Deploy Your Site
- pip freeze > requirements.txt
- mkdir .ebextensions
- vi .ebextensions/django.config
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: ebdjango/wsgi.pyo
- eb init -p python2.7 django-tutorial # you’ll be asked for your keys
- eb create django-env
- eb open
Recent Comments