Amazon Elastic Beanstalk: how to set wsgi path?

I practice setting up Django for Elastic Beanstalk from a document. But there is a mistake.

ERROR Your WSGIPath refers to a file that does not exist. 

My directory:

 -djangoenv (where I use git) - mysite -manage.py -mysite -__init__.py -settings.py -urls.py -wsgi.py 

and My .elasticbeanstalk/optionsettings.djapp , for example:

enter image description here

And .ebextensions/python.config like this, I donโ€™t know where to put this .try several times until it works. I'm trying mysite/mysite/wsgi.py still not working

 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 install my wsgi path?

Many thanks!

+5
source share
4 answers

I found that for this you need to restart the server in order to accept these changes.

I spent a lot of time changing and setting these parameters, and nothing worked. Then, when I went to the EB console and restarted the environment, it worked.

+6
source

On the server, you are going to deploy the django application to the elastic stem. Run:

eb config

Then replace application.py with mysite / wsgi.py and save the changes.

After the upgrade, you can:

git add. git commit -m "some updates" eb deploy

After successfully updating the environment, you can view the changes in the elastic material under your environment, go to the instance and check the setting in Configuration , and then view WSGIPath in the Software Configuration section.

Disclaimer: This information is valid until November 4, 2016. AWS may further change the setting.

+3
source

The path must be in the .elasticbeanstalk directory. The correct path should be mysite/mysite.wsgi.py . option_settings: ::

 option_settings: - namespace: aws:elasticbeanstalk:container:python option_name: WSGIPath value: mysite/mysite/wsgi.py - option_name: DJANGO_SETTINGS_MODULE value: mysite.settings 
+1
source

You have WSGIPath set to "application.py", but your WSGI file is "mysite / wsgi.py".

0
source

Source: https://habr.com/ru/post/1203712/


All Articles