成功部署后,Django Heroku应用程序无法运行

时间:2018-10-06 19:46:13

标签: python django heroku deployment

在成功部署Django项目之后,我做了几次尝试在dyno上运行此应用程序的尝试,但是,它会丢弃一些错误。它在本地运行没有问题。

ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
2018-10-06T19:08:44.455276+00:00 app[api]: Starting process with command `python manage.py migrate` by user tamerlanium@gmail.com
2018-10-06T19:08:51.519039+00:00 heroku[run.5633]: State changed from starting to up
2018-10-06T19:08:51.515345+00:00 heroku[run.5633]: Awaiting client
2018-10-06T19:08:51.578011+00:00 heroku[run.5633]: Starting process with command `python manage.py migrate`
2018-10-06T19:08:57.062762+00:00 heroku[run.5633]: State changed from up to complete
2018-10-06T19:08:57.046603+00:00 heroku[run.5633]: Process exited with status 1
2018-10-06T19:09:21.974583+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tarlansblog.herokuapp.com request_id=b037e1d6-8a68-4992-8c4e-21462664ff0e fwd="176.107.221.177" dyno= connect= service= status=503 bytes= protocol=https
2018-10-06T19:09:23.424575+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=tarlansblog.herokuapp.com request_id=05d085e7-cf21-47a8-9752-1da68c0fa940 fwd="176.107.221.177" dyno= connect= service= status=503 bytes= protocol=https
2018-10-06T19:10:05.844413+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tarlansblog.herokuapp.com request_id=9c64e68d-ba6c-422e-983c-9f9b30aac866 fwd="176.107.221.177" dyno= connect= service= status=503 bytes= protocol=https
2018-10-06T19:10:06.995437+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=tarlansblog.herokuapp.com request_id=9c9f6e8e-0233-4b3f-96c6-71882e4e17fe fwd="176.107.221.177" dyno= connect= service= status=503 bytes= protocol=https
2018-10-06T19:14:25.639377+00:00 app[api]: Starting process with command `python manage.py migrate` by user tamerlanium@gmail.com

1 个答案:

答案 0 :(得分:0)

我不确定,但是我会说您的静态文件有问题。当Heroku尝试获取它们时,您的状态为503。 也许您应该尝试查看如何在django项目中收集静态文件。此链接应帮助您解决此问题: https://devcenter.heroku.com/articles/django-assets

祝你好运!