我开始使用AWS的Elastic Beanstalk.
我按照这个tutorial来部署一个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
知道什么是错的吗?
最佳答案
您是否在应用程序的根目录中创建了requirements.txt? Elastic Beanstalk will automatically install the packages from this file upon deployment.(注意,可能需要检查要部署的源代码控制.)
pip freeze> requirements.txt
(您可能希望在virtualenv中执行此操作,以便您只获取应用程序实际需要运行的软件包.使用您的系统执行此操作Python将获取您在系统范围内安装的所有软件包.)