“没有名为'django_heroku'的模块”应用程序无法在Heroku上启动

问题描述 投票:0回答:1

试图推送到heroku服务器,我明白了:

git push heroku master

remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.7.3
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote:
remote: -----> Downloading NLTK corpora…
remote:  !     'nltk.txt' not found, not downloading any corpora
remote:  !     Learn more: https://devcenter.heroku.com/articles/python-nltk
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 206.4M
remote: -----> Launching...
remote:        Released v10
remote:        https://versally.herokuapp.com/ deployed to Heroku

但是,当我去我的应用程序时,它告诉我有一个错误。当我登录日志时,我看到了这个:

2019-04-30T13:22:00.633794+00:00 app[web.1]: import django_heroku
2019-04-30T13:22:00.633801+00:00 app[web.1]: ModuleNotFoundError: No module named 'django_heroku'
2019-04-30T13:22:00.634020+00:00 app[web.1]: [2019-04-30 13:22:00 +0000] [11] [INFO] Worker exiting (pid: 11)
2019-04-30T13:22:00.789044+00:00 app[web.1]: [2019-04-30 13:22:00 +0000] [4] [INFO] Shutting down: Master

我还没有设置数据库,但我只是想从django代码中获取调试消息,所以我可以从配置数据库开始。

python django heroku deployment
1个回答
-1
投票

对于有这个问题的人,我通过清空我的requirements.txt,推送(迫使Heroku卸载所有要求)然后通过aggain推送填充的需求来解决它。

我必须确保gunicorn被包含在要求中 - 就是这样,但是日志显示由于某种原因,heroku卸载了我的'陈旧'版本。

Heroku + gunicorn not working (bash: gunicorn: command not found )

© www.soinside.com 2019 - 2024. All rights reserved.