I practice set up Django under Elastic Beanstalk from there document. But There is error.
ERROR Your WSGIPath refers to a file that does not exist.
My directory like this:
-djangoenv (where I use git)
- mysite
-manage.py
-mysite
-__init__.py
-settings.py
-urls.py
-wsgi.py
and My the .elasticbeanstalk/optionsettings.djapp
file like this :
And .ebextensions/python.config
like this , I don't know where to put this .try several times still not work . I try mysite/mysite/wsgi.py
still not work
container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
option_settings:
- namespace: aws:elasticbeanstalk:container:python
option_name: WSGIPath
value: mysite/wsgi.py
- option_name: DJANGO_SETTINGS_MODULE
value: mysite.settings
Please tell me how and where to set my wsgi path ??
Thank you very much!
I found that you have to restart the server for it to take these changes into consideration.
I spent ages changing and tweaking these options and nothing worked. Then when I went to the EB console and restarted the environment it worked.
In the server you are about to deploy the django application to elasticbean stalk. Run:
eb config
Then replace the application.py to mysite/wsgi.py and save the changes.
After the update, you may do:
git add. git commit -m "some updates" eb deploy
After successfully update the environment, you may view the changes in elasticbeanstalk, under your enviroment, go to the instance and check the setting in Configuration, then view the WSGIPath under Software Configuration.
Disclaimer: This information is valid until 4 November 2016. AWS may further change the setting.
The path specified should be relative to the .elasticbeanstalk
directory.
The correct path should be mysite/mysite.wsgi.py
. option_settings:
is:
option_settings:
- namespace: aws:elasticbeanstalk:container:python
option_name: WSGIPath
value: mysite/mysite/wsgi.py
- option_name: DJANGO_SETTINGS_MODULE
value: mysite.settings
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