我正在尝试在Amazon Elastic Beanstalk上运行django应用程序,我正在关注this教程。
但是,在部署时,我收到500错误,并且在查看日志时:
ImportError: No module named settings
[Tue Sep 06 15:22:32.138981 2016] [:error] [pid 1940] [remote 127.0.0.1:42845] mod_wsgi (pid=1940): Target WSGI script '/opt/python/current/app/fasttext/wsgi.py' cannot be loaded as Python module.
[Tue Sep 06 15:22:32.139006 2016] [:error] [pid 1940] [remote 127.0.0.1:42845] mod_wsgi (pid=1940): Exception occurred processing WSGI script '/opt/python/current/app/fasttext/wsgi.py'.
好像我的wsgi.py文件是问题所在:
"""
WSGI config
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
application = get_wsgi_application()
我在SO和其他网站上阅读了很多主题,但没有一个解决方案适合我。
这是我的.ebextensions / django.config文件:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: fasttext/wsgi.py
有谁知道如何解决这个问题?
由于