Python 美国焊接学会beanstalk&x2B;Django:502坏网关-ModuleNotFoundError:没有名为';应用程序';
我正在尝试将Django项目部署到Elastic Beanstalk。 我遵循他们的指导: 但在Python 美国焊接学会beanstalk&x2B;Django:502坏网关-ModuleNotFoundError:没有名为';应用程序';,python,django,amazon-web-services,amazon-elastic-beanstalk,Python,Django,Amazon Web Services,Amazon Elastic Beanstalk,我正在尝试将Django项目部署到Elastic Beanstalk。 我遵循他们的指导: 但在eb打开后所有页面返回“502坏网关” 我的AWS管理员将django环境显示为“降级”。请参见屏幕截图: 我的日志似乎带有“ModuleNotFoundError:没有名为“application”的模块”: wsgi.py import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJA
eb打开后
所有页面返回“502坏网关”
我的AWS管理员将django环境显示为“降级”。请参见屏幕截图:
我的日志似乎带有“ModuleNotFoundError:没有名为“application”的模块”:
wsgi.py
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo.settings')
application = get_wsgi_application()
config.yaml
branch-defaults:
main:
environment: django-env
group_suffix: null
global:
application_name: todo
branch: null
default_ec2_keyname: null
default_platform: Python 3.7 running on 64bit Amazon Linux 2
default_region: eu-north-1
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application
非常感谢您的帮助 你检查过如何设置wsgi吗?@Marcin是的,我试过使用
WSGIPath:todo.wsgi:application
和WSGIPath:todo.wsgi
和WSGIPath:todo/wsgi.py
,但没有帮助。虽然我正在使用eb deploy
进行更改和更新,但也许我应该完全删除应用程序和环境,然后从头开始部署?@Marcin,问题是什么:我选择了Python 3.7,现在切换到3.6版本。然而,面临另一个问题:我无法创建环境,因为它一直崩溃,在日志中,它在上传djangorestframework simplejwt-收集djangorestframework simplejwt==4.6.0的阶段崩溃(来自-r/opt/python/ondeck/app/requirements.txt(第12行))找不到满足djangorestframework simplejwt==4.6.0要求的版本,但我已将其从requirements.txt和本地venv中删除。还是没用。它在缓存中的某个地方吗?有什么提示吗?如果你有新的问题,一个新的问题会更好,因为它会让新的眼睛看到。@NatalieLes你解决了这个问题吗?
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo.settings')
application = get_wsgi_application()
branch-defaults:
main:
environment: django-env
group_suffix: null
global:
application_name: todo
branch: null
default_ec2_keyname: null
default_platform: Python 3.7 running on 64bit Amazon Linux 2
default_region: eu-north-1
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application