I am using this tutorial: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
I create the .ebextensions
directory inside the root directory, and put this django.config
file in it:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: mysite/wsgi.py
I've also tried setting the path to mysite/mysite/wsgi.py
because I saw that work somewhere but it did not help me.
Everywhere I look shows a different .config
file with different arrangements, and I don't know where to go from here. How can I properly set my WSGIPath in Elastic Beanstalk?
[Solution]
1 eb config
2 Change the WSGIPath there from application.py to mysite/wsgi.py
That's It
I ran into a similar issue, and it seemed to resolve when I put .elasticbeanstalk in the same directory as .ebextensions, rather than having it be a child directory. Then I had to run eb config
to fix the wsgi file that it was de facto picking up, and now I have a running app.
Make sure that .ebextensions isn't ignored. EB looks for .ignore file (.ebignore by default and if it doesnt exists but .gitignore does, it will use it) and deploy only the files that are not ignored. Had a similar issue with my local_settings.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html#eb-cli3-ebignore
I did not use console but GUI.
ERROR: Your WSGIPath refers to a file that does not exist.
where could be problem : Creating .zip file
select all : files of your project (not the project folder)
Note : weworkout is my django project (created by django-admin startproject weworkout)
Right way : select all files
Wrong way : selecting project folder
Also this is the only change you have to do to your django project before uploading
weworkout/.ebextensions/django.config file contains
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: weworkout/wsgi.py
Note : .ebextensions is in same folder as manage.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With