Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django; AWS Elastic Beanstalk ERROR: Your WSGIPath refers to a file that does not exist

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?

like image 242
conjenks Avatar asked Jul 29 '16 03:07

conjenks


4 Answers

[Solution]

1 eb config

2 Change the WSGIPath there from application.py to mysite/wsgi.py

That's It

like image 180
karan Avatar answered Nov 17 '22 12:11

karan


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.

like image 2
Aviendha Avatar answered Nov 17 '22 12:11

Aviendha


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

like image 2
Michał D Avatar answered Nov 17 '22 12:11

Michał D


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

Right way

Wrong way : selecting project folder

wrong way


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

like image 1
Vishal Singh Avatar answered Nov 17 '22 12:11

Vishal Singh