Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Elastic Beanstalk:没有名为settings的模块_Python_Django_Amazon Web Services_Amazon Elastic Beanstalk - Fatal编程技术网

Python Elastic Beanstalk:没有名为settings的模块

Python Elastic Beanstalk:没有名为settings的模块,python,django,amazon-web-services,amazon-elastic-beanstalk,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/cu

我正试图在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'.
问题似乎出在我的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
有人知道如何解决这个问题吗


谢谢

您能显示您的文件夹/文件布局吗?我想知道是否有
/fasttext/\uuuuu init\uuuuuuu.py
文件?是否指定了设置文件?选项设置:“aws:elasticbeanstalk:application:environment”:DJANGO\u设置模块:“path\u to\u settings.settings”您的wsgi.py将设置路径指定为
(“DJANGO\u settings\u模块”,“settings”)
我猜应该是
(“DJANGO\u设置\u模块”,“fasttext.settings”)
@Graham您能解决这个问题吗?