jeudi 29 mai 2014

des services web d'Amazon - déploiement projet django sur AWS elastic beanstalk - Stack Overflow


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


My app works when I test locally but when I deploy, I'm getting a 404 error. Looking at the event logs, I see this message:


Error running user's 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


That leads me to believe that the tutorial is missing a part about installing django files on the server or at least configuring my project to recognize django-admin.py. I have django installed on my local machine so it works there.


I know python support is brand new for elastic beanstalk but has anyone deployed django to it?




I believe you don't need to put container_commands in .config because there is no database or table at this moment.




I followed the same tutorial recently and had a similar result.


At step 6, upon seeing the default django 'congrats' page render locally, I deployed to EB as instructed and got a 404 instead of the default 'congrats' page.


I decided to use the code up to that point as a foundation for following the 'getting started with django tutorial' which led me to a successful rendering of a 'home' view. This is a much more useful place to be anyway. I do agree that there is something wrong with the AWS tutorial and posted to the AWS forums here.




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


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




Did you made the step?: Freeze the requirements.txt file.


(djangodev)# pip freeze > requirements.txt

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


Django==1.4.1
MySQL-python==1.2.3

I had the same problem because I skipped it. Once I did it, add, commit and push. It works!



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


My app works when I test locally but when I deploy, I'm getting a 404 error. Looking at the event logs, I see this message:


Error running user's 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


That leads me to believe that the tutorial is missing a part about installing django files on the server or at least configuring my project to recognize django-admin.py. I have django installed on my local machine so it works there.


I know python support is brand new for elastic beanstalk but has anyone deployed django to it?



I believe you don't need to put container_commands in .config because there is no database or table at this moment.



I followed the same tutorial recently and had a similar result.


At step 6, upon seeing the default django 'congrats' page render locally, I deployed to EB as instructed and got a 404 instead of the default 'congrats' page.


I decided to use the code up to that point as a foundation for following the 'getting started with django tutorial' which led me to a successful rendering of a 'home' view. This is a much more useful place to be anyway. I do agree that there is something wrong with the AWS tutorial and posted to the AWS forums here.



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


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



Did you made the step?: Freeze the requirements.txt file.


(djangodev)# pip freeze > requirements.txt

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


Django==1.4.1
MySQL-python==1.2.3

I had the same problem because I skipped it. Once I did it, add, commit and push. It works!


0 commentaires:

Enregistrer un commentaire