我刚开始使用AWS 的弹性豆茎.
我正在关注这个tutorial https://realpython.com/blog/python/deploying-a-django-app-to-aws-elastic-beanstalk/ to 部署 Django/PostgreSQL 应用程序.
我在“配置数据库”部分之前完成了所有操作。部署也成功,但我收到内部服务器错误。
这是日志的回溯:
mod_wsgi (pid=30226): Target WSGI script '/opt/python/current/app/polly/wsgi.py' cannot be loaded as Python module.
[Tue Sep 15 12:06:43.472954 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] mod_wsgi (pid=30226): Exception occurred processing WSGI script '/opt/python/current/app/polly/wsgi.py'.
[Tue Sep 15 12:06:43.474702 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] Traceback (most recent call last):
[Tue Sep 15 12:06:43.474727 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] File "/opt/python/current/app/polly/wsgi.py", line 12, in <module>
[Tue Sep 15 12:06:43.474777 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] from django.core.wsgi import get_wsgi_application
[Tue Sep 15 12:06:43.474799 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] ImportError: No module named django.core.wsgi
知道出了什么问题吗?
您是否创建了一个requirements.txt
在你的应用程序的根目录中?Elastic Beanstalk 将在部署时自动安装此文件中的包。 http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/python-configuration-requirements.html(请注意,可能需要将其签入源代码管理才能部署。)
pip freeze > requirements.txt
(您可能希望在 virtualenv 中执行此操作,以便只获取应用程序实际需要运行的包。在系统中执行此操作,Python 将获取您在系统范围内安装的每个包。)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)