Question:
I’ve tried everything suggested so far but nothing seems to work. I’ve created a new Django project with Cookiecutter. I’m able to run it locally and via my Docker machine but for some reason I can’t get it to deploy to
AWS. I’ve also been following along this documentation loosely:
.ebextensions/django.config
1 2 3 4 |
option_settings: aws:elasticbeanstalk:container:python: WSGIPath: config/wsgi.py |
Project Structure
1 2 3 4 5 6 7 8 9 10 11 |
~/project |-- .ebextensions |-- `-- django.config |-- .elasticbeanstalk |-- `--config.yml |--config |-- | ... |-- | wsgi.py |-- project |-- manage.py |
When I check the logs, this is a sample of what I get:
1 2 |
Target WSGI script not found or unable to stat: /opt/python/current/app/application.py |
When I run eb config I get these settings:
1 2 3 4 5 6 |
aws:elasticbeanstalk:container:python: NumProcesses: '1' NumThreads: '15' StaticFiles: /static/=static/ WSGIPath: application.py |
I’ve tried editing this, moving the wsgi.py file, renaming it, but nothing works. What am I doing wrong?
Answer:
The problem for me was that I made code changes but I didn’t commit them. When I tried to deploy to elastic beanstalk with eb deploy
, it was deploying my old code which had reference to application.py
instead of myproject/wsgi.py