Elastic Beanstalk:没有模块命名设置

Gra*_*ick 5 python django amazon-web-services amazon-elastic-beanstalk

我正在尝试在 Amazon Elastic Beanstalk 上运行 django 应用程序,我正在学习教程。

但是,在部署时,我收到 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'.
Run Code Online (Sandbox Code Playgroud)

似乎我的 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()
Run Code Online (Sandbox Code Playgroud)

我在 SO 和其他网站上阅读了许多主题,但没有一个解决方案对我有用。

这是我的 .ebextensions/django.config 文件:

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: fasttext/wsgi.py
Run Code Online (Sandbox Code Playgroud)

有谁知道如何解决这一问题 ?

谢谢