简体   繁体   English

Django 'ModuleNotFoundError:部署到 Elastic Beanstalk 时没有名为'blog/wsgi' 的模块,以及'连接到上游时出错'

[英]Django 'ModuleNotFoundError: No module named 'blog/wsgi' when deploying to Elastic Beanstalk, as well as 'Error while connecting to Upstream'

I am trying to deploy a static Django website to Elastic Beanstalk via the UI 'upload your code' and not the EB CLI.我正在尝试通过 UI“上传您的代码”而不是 EB CLI 将 static Django 网站部署到 Elastic Beanstalk。 I have created a zip file of all of my contents and have tried uploading it a million times, only to be met with the errors 'ModuleNotFoundError: No module named 'blog/wsgi' when deploying to Elastic Beanstalk, as well as 'Error while connecting to Upstream'.我已经为我的所有内容创建了一个 zip 文件,并尝试将其上传一百万次,结果却遇到错误“ModuleNotFoundError:部署到 Elastic Beanstalk 时没有名为‘blog/wsgi’的模块”,以及“同时出错”连接到上游”。 I think it is an error with the 'django.config' file in my.ebextensions folder.我认为这是 my.ebextensions 文件夹中的“django.config”文件的错误。 The contents of the 'django.config' file is: option_settings: aws:elasticbeanstalk:container:python: WSGIPath: blog/wsgi:application . “django.config”文件的内容是: option_settings: aws:elasticbeanstalk:container:python: WSGIPath: blog/wsgi:application The contents of my 'wsgi.py' file is import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blog.blog.settings') application = get_wsgi_application() .我的“wsgi.py”文件的内容是import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'blog.blog.settings') application = get_wsgi_application() I have attached a screenshot of my folder structure as well.我还附上了我的文件夹结构的屏幕截图。 I can attach any other files if necessary.如有必要,我可以附上任何其他文件。 Thank you.谢谢你。

I faced the same issue when deploying to Amazon Linux 2 machine due to incompatibility of versions.由于版本不兼容,我在部署到 Amazon Linux 2 机器时遇到了同样的问题。 I fixed it by changing the django.config file:我通过更改 django.config 文件修复了它:

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: ebdjango.wsgi

Credits to this answer归功于这个答案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:部署到 Elastic Beanstalk 时没有名为“django”的模块 - ModuleNotFoundError: No module named 'django' when deploying to Elastic Beanstalk ModuleNotFoundError:Elastic Beanstalk 上没有名为“django”的模块 - ModuleNotFoundError: No module named 'django' on Elastic Beanstalk wsgi: ModuleNotFoundError: No module named 'django' 错误 - wsgi: ModuleNotFoundError: No module named 'django' error ImportError:Elastic Beanstalk中没有名为django.core.wsgi的模块 - ImportError: No module named django.core.wsgi in Elastic Beanstalk ModuleNotFoundError:部署到ElasticBeanstalk时没有名为'django'的模块 - ModuleNotFoundError: No module named 'django' while deploying to ElasticBeanstalk ModuleNotFoundError:将 Django 应用程序部署到 heroku 时没有名为“games.wsgi”的模块 - ModuleNotFoundError: No module named 'games.wsgi' when deploying Django app to heroku 没有模块命名设置错误 django 弹性豆茎 - No module named settings error django elastic beanstalk 运行 WSGI 应用程序时出错,ModuleNotFoundError: No module named 'django_countries' - Error running WSGI application, ModuleNotFoundError: No module named 'django_countries' mod_wsgi错误:ModuleNotFoundError:没有名为“ django”的模块 - mod_wsgi error: ModuleNotFoundError: No module named 'django' Django WSGI APACHE ModuleNotFoundError:没有名为“django”的模块 - Django WSGI APACHE ModuleNotFoundError: No module named 'django'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM