Deploying django project on AWS Elastic Beanstalk

I am following a tutorial on deploying a django project on an elastic AWS beanstalk here: http://docs.amazonwebservices.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html

My application works when I test locally, but when deployed, I get a 404 error. Looking at the event logs, I see this message:

Error running user commands : An error occurred running '. /opt/python/ondeck/env && PYTHONPATH=/opt/python/ondeck/app: django-admin.py syncdb --noinput' (rc: 127) /bin/sh: django-admin.py: command not found

This makes me think that the tutorial is missing a part about installing django files on the server or at least setting up my project to recognize django-admin.py. I have django installed on my local machine, so it works there.

I know python support is completely new for elastic beanstalk, but has anyone deployed django?

+7
source share
5 answers

I believe that you do not need to put container_commands in .config, because there is currently no database or table.

+2
source

You have taken the step: Freeze the requirements.txt file.

 (djangodev)# pip freeze > requirements.txt 

Note Make sure the requirements.txt file contains the following:

 Django==1.4.1 MySQL-python==1.2.3 

I had the same problem because I missed it. Once I have done this, add, commit and click. He works!

+2
source

I recently entered the same textbook and got a similar result.

In step 6, when I saw the local django 'congrats' page displayed locally, I deployed it to EB, as indicated, and got 404 instead of the default congrats page.

I decided to use the code up to this point as the basis for getting started with the django tutorial , which led me to successfully display the "home" view. This is a much more useful place anyway. I agree that something is wrong with the AWS tutorial and is posted on the AWS forums here .

+1
source

If you can, you should try to access the log file; this may give you a better idea of ​​what is going on. Here's a link that might help:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.loggingS3.title.html

+1
source

I asked a similar question, to which I answered myself. Here's the Deploy Django Using Docker link on Amazon Elastic Beanstalk

0
source

All Articles