Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

deploy django site to aws

# You have to follow up some steps to deploy django project on aws
pip install virtualenv aswebcli
virtualenv -m venv environment_name
cd environment_name
# make directory with .ebextentions name i.e
mkdir .ebextentions
# create a config file
nono .ebextentions/django-config
# once inside, type following code with exact spacing as here
option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: project/wsgi.py
# now deactivate and run
eb init -p python-3.10 project-name-aws
#now you are good to go# it will ask for region, Access Key ID, Secret Key access 
eb init # enter all that is required, got to IAM in aws, Access Key, Secret Access Key
# after eb init run
eb create django-env #usually takes 5 min to create
eb status #in status, there is a linke provided, put that link in ALLOWED_HOST in settings.py
#using command 'nano project-name/settings.py'
eb console # go to configuration
 
PREVIOUS NEXT
Tagged: #deploy #django #site #aws
ADD COMMENT
Topic
Name
4+1 =