Heroku上的Django:错误= H10,没有名为Django的模块

时间:2016-11-29 19:36:12

标签: django heroku

从最近2个小时开始,我尝试在Heroku上部署我的Django项目。

我已阅读所有类似问题的解决方案,但我仍然看到heroku logs执行以下错误:

ImportError: No module named 'django'
2016-11-29T18:26:33.959843+00:00 app[web.1]: [2016-11-29 18:26:33 +0000] [4] [INFO] Reason: Worker failed to boot.
2016-11-29T18:26:34.092546+00:00 heroku[web.1]: State changed from starting to crashed
2016-11-29T18:26:34.083366+00:00 heroku[web.1]: Process exited with status 3
2016-11-29T18:26:37.057428+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=intense-thicket-    88077.herokuapp.com request_id=6ec39e42-b2b4-486d-8211-7b6ed096eb67 fwd="202.142.70.146" dyno= connect= service= status=503 bytes=
2016-11-29T18:28:10.720588+00:00 heroku[run.5806]: Awaiting client
2016-11-29T18:28:10.680678+00:00 heroku[run.5806]: State changed from starting to up
2016-11-29T18:28:40.724034+00:00 heroku[run.5806]: Error R13 (Attach error) -> Failed to attach to process
2016-11-29T18:28:40.728213+00:00 heroku[run.5806]: Process exited with status 128
2016-11-29T18:28:40.741231+00:00 heroku[run.5806]: State changed from up to complete
2016-11-29T18:31:26.538645+00:00 heroku[run.4330]: Awaiting client
2016-11-29T18:31:26.740288+00:00 heroku[run.4330]: State changed from starting to up
2016-11-29T18:31:56.547335+00:00 heroku[run.4330]: Error R13 (Attach error) -> Failed to attach to process
2016-11-29T18:31:56.547335+00:00 heroku[run.4330]: Process exited with status 128
2016-11-29T18:31:56.572416+00:00 heroku[run.4330]: State changed from up to complete
2016-11-29T18:43:50.795965+00:00 heroku[web.1]: State changed from crashed to starting
2016-11-29T18:43:54.458675+00:00 heroku[web.1]: Starting process with command `gunicorn sachin_test_app.wsgi --log-file -`
2016-11-29T18:43:56.697645+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [4] [INFO] Starting gunicorn 19.6.0
2016-11-29T18:43:56.698106+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [4] [INFO] Listening at: http://0.0.0.0:13028 (4)
2016-11-29T18:43:56.698211+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [4] [INFO] Using worker: sync
2016-11-29T18:43:56.701032+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [8] [INFO] Booting worker with pid: 8
2016-11-29T18:43:56.705615+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [8] [ERROR] Exception in worker process
2016-11-29T18:43:56.705617+00:00 app[web.1]: Traceback (most recent call last):
2016-11-29T18:43:56.705617+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2016-11-29T18:43:56.705618+00:00 app[web.1]:     worker.init_process()
2016-11-29T18:43:56.705619+00:00 app[web.1]:     self.load_wsgi()
2016-11-29T18:43:56.705618+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 126, in init_process
2016-11-29T18:43:56.705620+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
2016-11-29T18:43:56.705619+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2016-11-29T18:43:56.705621+00:00 app[web.1]:     self.callable = self.load()
2016-11-29T18:43:56.705620+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-11-29T18:43:56.705621+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-11-29T18:43:56.705622+00:00 app[web.1]:     return self.load_wsgiapp()
2016-11-29T18:43:56.705622+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-11-29T18:43:56.705623+00:00 app[web.1]:     return util.import_app(self.app_uri)
2016-11-29T18:43:56.705623+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/util.py", line 357, in import_app
2016-11-29T18:43:56.705623+00:00 app[web.1]:     __import__(module)
2016-11-29T18:43:56.705624+00:00 app[web.1]:   File "/app/sachin_test_app/wsgi.py", line 12, in <module>
2016-11-29T18:43:56.705624+00:00 app[web.1]:     from django.core.wsgi import get_wsgi_application
2016-11-29T18:43:56.705627+00:00 app[web.1]: ImportError: No module named 'django'
2016-11-29T18:43:56.705740+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [8] [INFO] Worker exiting (pid: 8)
2016-11-29T18:43:56.735713+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [4] [INFO] Shutting down: Master
2016-11-29T18:43:56.735790+00:00 app[web.1]: [2016-11-29 18:43:56 +0000] [4] [INFO] Reason: Worker failed to boot.
2016-11-29T18:43:56.817166+00:00 heroku[web.1]: State changed from starting to crashed
2016-11-29T18:43:56.806130+00:00 heroku[web.1]: Process exited with status 3
2016-11-29T19:04:59.722404+00:00 heroku[web.1]: State changed from crashed to starting
2016-11-29T19:05:04.117947+00:00 heroku[web.1]: Starting process with command `gunicorn sachin_test_app.wsgi --log-file -`
2016-11-29T19:05:07.043998+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [4] [INFO] Starting gunicorn 19.6.0
2016-11-29T19:05:07.051783+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [4] [INFO] Listening at: http://0.0.0.0:50515 (4)
2016-11-29T19:05:07.051974+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [4] [INFO] Using worker: sync
2016-11-29T19:05:07.067007+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [8] [INFO] Booting worker with pid: 8
2016-11-29T19:05:07.085655+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [9] [INFO] Booting worker with pid: 9
2016-11-29T19:05:07.096115+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [9] [ERROR] Exception in worker process
2016-11-29T19:05:07.096118+00:00 app[web.1]: Traceback (most recent call last):
2016-11-29T19:05:07.096119+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2016-11-29T19:05:07.096120+00:00 app[web.1]:     worker.init_process()
2016-11-29T19:05:07.096121+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 126, in init_process
2016-11-29T19:05:07.096122+00:00 app[web.1]:     self.load_wsgi()
2016-11-29T19:05:07.096122+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2016-11-29T19:05:07.096123+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
2016-11-29T19:05:07.096124+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-11-29T19:05:07.096125+00:00 app[web.1]:     self.callable = self.load()
2016-11-29T19:05:07.096125+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-11-29T19:05:07.096126+00:00 app[web.1]:     return self.load_wsgiapp()
2016-11-29T19:05:07.096127+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-11-29T19:05:07.096127+00:00 app[web.1]:     return util.import_app(self.app_uri)
2016-11-29T19:05:07.096128+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/util.py", line 357, in import_app
2016-11-29T19:05:07.096129+00:00 app[web.1]:     __import__(module)
2016-11-29T19:05:07.096130+00:00 app[web.1]:   File "/app/sachin_test_app/wsgi.py", line 12, in <module>
2016-11-29T19:05:07.096130+00:00 app[web.1]:     from django.core.wsgi import get_wsgi_application
2016-11-29T19:05:07.096131+00:00 app[web.1]: ImportError: No module named 'django'
2016-11-29T19:05:07.096294+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [9] [INFO] Worker exiting (pid: 9)
2016-11-29T19:05:07.117308+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [8] [ERROR] Exception in worker process
2016-11-29T19:05:07.117311+00:00 app[web.1]: Traceback (most recent call last):
2016-11-29T19:05:07.117314+00:00 app[web.1]:     self.load_wsgi()
2016-11-29T19:05:07.117313+00:00 app[web.1]:     worker.init_process()
2016-11-29T19:05:07.117315+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2016-11-29T19:05:07.117317+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-11-29T19:05:07.117314+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/workers/base.py", line 126, in init_process
2016-11-29T19:05:07.117317+00:00 app[web.1]:     self.callable = self.load()
2016-11-29T19:05:07.117316+00:00 app[web.1]:     self.wsgi = self.app.wsgi()
2016-11-29T19:05:07.117312+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2016-11-29T19:05:07.117318+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-11-29T19:05:07.117318+00:00 app[web.1]:     return self.load_wsgiapp()
2016-11-29T19:05:07.117319+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-11-29T19:05:07.117320+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.5/site-packages/gunicorn/util.py", line 357, in import_app
2016-11-29T19:05:07.117320+00:00 app[web.1]:     return util.import_app(self.app_uri)
2016-11-29T19:05:07.117322+00:00 app[web.1]:     from django.core.wsgi import get_wsgi_application
2016-11-29T19:05:07.117321+00:00 app[web.1]:     __import__(module)
2016-11-29T19:05:07.117322+00:00 app[web.1]:   File "/app/sachin_test_app/wsgi.py", line 12, in <module>
2016-11-29T19:05:07.117327+00:00 app[web.1]: ImportError: No module named 'django'
2016-11-29T19:05:07.136615+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [8] [INFO] Worker exiting (pid: 8)
2016-11-29T19:05:07.250037+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [4] [INFO] Shutting down: Master
2016-11-29T19:05:07.250163+00:00 app[web.1]: [2016-11-29 19:05:07 +0000] [4] [INFO] Reason: Worker failed to boot.
2016-11-29T19:05:07.586626+00:00 heroku[web.1]: State changed from starting to crashed
2016-11-29T19:05:07.569952+00:00 heroku[web.1]: Process exited with status 3
2016-11-29T19:19:25.003934+00:00 heroku[run.2944]: Awaiting client
2016-11-29T19:19:25.218914+00:00 heroku[run.2944]: State changed from starting to up
2016-11-29T19:19:55.012005+00:00 heroku[run.2944]: State changed from up to complete
2016-11-29T19:19:55.008626+00:00 heroku[run.2944]: Error R13 (Attach error) -> Failed to attach to process
2016-11-29T19:19:55.011515+00:00 heroku[run.2944]: Process exited with status 128
2016-11-29T19:21:44.348806+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=intense-thicket-88077.herokuapp.com request_id=fc07cdbd-fd4c-436d-8305-0859b68eccf1 fwd="202.142.70.146" dyno= connect= service= status=503 bytes=

这是我第一次在Heroku上部署Django应用程序。我该怎么办?

我试过再次缩放dyno。

heroku pip install gunicorn

返回:

  ETIMEDOUT: connect ETIMEDOUT 50.19.103.36:5000

请帮忙!谢谢!

1 个答案:

答案 0 :(得分:0)

这是愚蠢的...我的坏!

我没有在reqirements.txt中包含django

django==1.9.2

就是这样:)