[英]Django AWS Elastic Beanstalk WSGIPath refers to a file that does not exist
I've tried everything suggested so far but nothing seems to work. 到目前为止,我已经尝试了所有建议,但似乎没有任何工作。 I've created a new Django project with Cookiecutter.
我用Cookiecutter创建了一个新的Django项目。 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.
我可以在本地运行它并通过我的Docker机器运行但由于某种原因我无法将其部署到AWS。 I've also been following along this documentation loosely:
我也一直在松散地阅读这些文档:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html#python-django-configure-for-eb http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html#python-django-configure-for-eb
.ebextensions/django.config .ebextensions / django.config
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: config/wsgi.py
Project Structure 项目结构
~/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: 当我检查日志时,这是我得到的样本:
Target WSGI script not found or unable to stat: /opt/python/current/app/application.py
When I run eb config I get these settings: 当我运行eb配置时,我得到以下设置:
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. 我已经尝试编辑这个,移动wsgi.py文件,重命名它,但没有任何作用。 What am I doing wrong?
我究竟做错了什么?
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
当我尝试使用
eb deploy
部署到弹性beanstalk时,它正在部署我的旧代码,该代码引用了application.py
而不是myproject/wsgi.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.