aaa
aaa

Reputation: 89

deploy django to AWS Elastic Beanstalk

I would like to deploy my django project to AWS Elastic Beanstalk. My project was not create through eb-virt. Do I need to redo the project again in eb-virt? I have no idea of how to deploy my project directly.

Upvotes: 1

Views: 404

Answers (1)

Arun Kamalanathan
Arun Kamalanathan

Reputation: 8583

It is always recommended to work on a virtual environment. it is important because you can have your very own python environment with all the modules you need for the app installed. The good news is that it's not yet late to create the virtual environment.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html

to setup the project

  1. goto your folder
  2. create the virtual environment using virtualenv ~/eb-virt
  3. activate the virtual environment source ~/eb-virt/bin/activate
  4. install django pip install django==2.1.1
  5. create the requirements.txt file by running pip freeze > requirements.txt. because elasticbeanstalk can install the dependecies mentioned in this file.
  6. do the 3rd to 5th steps from the link above

to deploy

follow the deploy section, basically

  1. init the project eb init -p python-3.6 django-tutorial
  2. create an environment eb create django-env, we used to have Dev, staging and production environments
  3. continue steps 4th to 7th

Upvotes: 0

Related Questions