Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django versions on AWS elastic beanstalk

According to this (old) tutorial the django version on elastic beanstalk should be 1.4.1.

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html

The tutorial explains you should put in your requirements.txt file:

Django==1.4.1

My project is already half written using django 1.6.1, does anybody know if it'll work on elastic beanstalk if I simply put in requirements.txt

Django==1.6.1

If not, will django 1.5 work?

(For technical reasons I can't set up an account in AWS now so I can't create a django 1.6 project and test that it works fine.)

like image 770
Dan Avatar asked Oct 21 '22 17:10

Dan


1 Answers

I have an Elastic Beanstalk application working just fine with Django 1.6.5 and many add-ons. Here is my requirements.txt used in the deployment:

Django==1.6.5
MySQL-python==1.2.5
South==0.8.4
boto==2.28.0
Markdown==2.4.1
django-filter==0.7
django-guardian==1.2.0
django-oauth-plus==2.2.4
django-oauth2-provider==0.2.6.1
django-storages==1.1.8
djangorestframework==2.3.14
httplib2==0.9
oauth2==1.5.211
shortuuid==0.4.2
six==1.7.2

At some point I did get a hook error from /opt/elasticbeanstalk/hooks/appdeploy/enact/01flip.py failing to restart apache. After a few retries it started successfully. It doesn't happen every time. I just did git aws.push about 3 times then it spun up OK.

EDIT: I have since found that it can sometimes be helpful to restart the EC2 instance hosting the application from EC2. I have also found that the application is more stable if the minimum server count is set to at least 2.

I hope this helps! I love running Django in AWS Elastic Beanstalk. I just wish I had started with Django 1.7 and Django Rest Framework 3.0. Someday I will migrate!

like image 170
e.thompsy Avatar answered Oct 23 '22 09:10

e.thompsy