2014-02-28 136 views
0

試圖在Heroku上啓動Django Web應用程序。Heroku上的Django應用程序:應用程序錯誤

獲取應用程序錯誤:應用程序中發生錯誤,並且無法爲您的頁面提供服務。請稍後重試。如果您是應用程序所有者,請查看日誌以獲取詳細信息。

Heroku的日誌:

2014-02-28T01:49:58.706311+00:00 heroku[run.6585]: Starting process with command `rake` 
2014-02-28T01:50:01.064056+00:00 heroku[run.6585]: Process exited with status 1 
2014-02-28T01:50:01.078817+00:00 heroku[run.6585]: State changed from up to complete 
2014-02-28T01:47:36.064095+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=whispering-waters-3343.herokuapp.com request_id=8dd34dc2-41ee-40ef-b603-e731ba8a6078 fwd="173.164.141.93" dyno= connect= service= status=503 bytes= 
2014-02-28T01:49:52.192771+00:00 heroku[api]: Starting process with command `rake` by [email protected] 
2014-02-28T01:51:19.326151+00:00 heroku[run.7560]: Awaiting client 
2014-02-28T01:51:19.358198+00:00 heroku[run.7560]: State changed from starting to up 
2014-02-28T01:51:19.362731+00:00 heroku[run.7560]: Starting process with command `python manage.py syncdb` 
2014-02-28T01:51:21.075401+00:00 heroku[run.7560]: State changed from up to complete 
2014-02-28T01:51:21.062102+00:00 heroku[run.7560]: Process exited with status 2 
2014-02-28T01:51:30.442655+00:00 heroku[api]: Starting process with command `python mysite/manage.py syncdb` by [email protected] 
2014-02-28T01:51:36.973260+00:00 heroku[run.9486]: Awaiting client 
2014-02-28T01:51:37.100935+00:00 heroku[run.9486]: Starting process with command `python mysite/manage.py syncdb` 
2014-02-28T01:52:01.887843+00:00 heroku[run.9486]: Process exited with status 0 
2014-02-28T01:49:46.430021+00:00 heroku[run.4760]: State changed from up to complete 
2014-02-28T01:52:11.589525+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=whispering-waters-3343.herokuapp.com request_id=8cd012cf-37cd-424e-8e69-c8463d488d95 fwd="173.164.141.93" dyno= connect= service= status=503 bytes= 
2014-02-28T01:52:12.020302+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=whispering-waters-3343.herokuapp.com request_id=fe3d19e2-af38-46b6-a9f2-2f3e76bd4bff fwd="173.164.141.93" dyno= connect= service= status=503 bytes= 
2014-02-28T01:52:01.902293+00:00 heroku[run.9486]: State changed from up to complete 
2014-02-28T01:55:19.056405+00:00 heroku[web.1]: Starting process with command `gunicorn hellodjango.wsgi` 
2014-02-28T01:55:20.491536+00:00 app[web.1]: 2014-02-28 01:55:20 [2] [INFO] Listening at: http://0.0.0.0:45860 (2) 
2014-02-28T01:55:20.490915+00:00 app[web.1]: 2014-02-28 01:55:20 [2] [INFO] Starting gunicorn 18.0 
2014-02-28T01:55:20.502381+00:00 app[web.1]: 2014-02-28 01:55:20 [2] [INFO] Using worker: sync 
2014-02-28T01:55:20.520439+00:00 app[web.1]: 2014-02-28 01:55:20 [7] [INFO] Booting worker with pid: 7 
2014-02-28T01:55:20.532572+00:00 app[web.1]: 2014-02-28 01:55:20 [7] [ERROR] Exception in worker process: 
2014-02-28T01:55:20.532572+00:00 app[web.1]: Traceback (most recent call last): 
2014-02-28T01:55:20.532572+00:00 app[web.1]:  self.wsgi = self.app.wsgi() 
2014-02-28T01:55:20.532572+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker 
2014-02-28T01:55:20.532812+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp 
2014-02-28T01:55:20.532812+00:00 app[web.1]:  return util.import_app(self.app_uri) 
2014-02-28T01:55:20.532812+00:00 app[web.1]:  __import__(module) 
2014-02-28T01:55:20.532572+00:00 app[web.1]:  worker.init_process() 
2014-02-28T01:55:20.532572+00:00 app[web.1]:  self.callable = self.load() 
2014-02-28T01:55:20.532572+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process 
2014-02-28T01:55:20.532572+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load 
2014-02-28T01:55:20.532812+00:00 app[web.1]:  self.wsgi = self.app.wsgi() 
2014-02-28T01:55:20.532812+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process 
2014-02-28T01:55:20.532812+00:00 app[web.1]: Traceback (most recent call last): 
2014-02-28T01:55:20.533000+00:00 app[web.1]:  self.callable = self.load() 
2014-02-28T01:55:20.532572+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi 
2014-02-28T01:55:20.532572+00:00 app[web.1]:  return self.load_wsgiapp() 
2014-02-28T01:55:20.532812+00:00 app[web.1]: ImportError: No module named hellodjango.wsgi 
2014-02-28T01:55:20.532812+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app 
2014-02-28T01:55:20.532812+00:00 app[web.1]:  worker.init_process() 
2014-02-28T01:55:20.533000+00:00 app[web.1]:  __import__(module) 
2014-02-28T01:55:20.533000+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load 
2014-02-28T01:55:20.533000+00:00 app[web.1]: 2014-02-28 01:55:20 [7] [INFO] Worker exiting (pid: 7) 
2014-02-28T01:55:20.533000+00:00 app[web.1]:  return self.load_wsgiapp() 
2014-02-28T01:55:20.533000+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp 
2014-02-28T01:55:20.533000+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi 
2014-02-28T01:55:20.533000+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app 
2014-02-28T01:55:20.532812+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker 
2014-02-28T01:55:20.533000+00:00 app[web.1]: ImportError: No module named hellodjango.wsgi 
2014-02-28T01:55:20.533000+00:00 app[web.1]:  return util.import_app(self.app_uri) 
2014-02-28T01:55:20.689228+00:00 app[web.1]: 2014-02-28 01:55:20 [2] [INFO] Shutting down: Master 
2014-02-28T01:55:20.689360+00:00 app[web.1]: 2014-02-28 01:55:20 [2] [INFO] Reason: Worker failed to boot. 
2014-02-28T01:55:21.970445+00:00 heroku[web.1]: Process exited with status 3 
2014-02-28T01:55:27.158974+00:00 heroku[web.1]: Starting process with command `gunicorn hellodjango.wsgi` 
2014-02-28T01:55:28.155161+00:00 app[web.1]: 2014-02-28 01:55:28 [2] [INFO] Starting gunicorn 18.0 
2014-02-28T01:55:28.156682+00:00 app[web.1]: 2014-02-28 01:55:28 [2] [INFO] Listening at: http://0.0.0.0:8671 (2) 
2014-02-28T01:55:28.156682+00:00 app[web.1]: 2014-02-28 01:55:28 [2] [INFO] Using worker: sync 
2014-02-28T01:55:28.166192+00:00 app[web.1]: 2014-02-28 01:55:28 [7] [INFO] Booting worker with pid: 7 
2014-02-28T01:55:28.171442+00:00 app[web.1]: 2014-02-28 01:55:28 [7] [ERROR] Exception in worker process: 
2014-02-28T01:55:28.171442+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi 
2014-02-28T01:55:28.171442+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load 
2014-02-28T01:55:28.171442+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker 
2014-02-28T01:55:28.171442+00:00 app[web.1]: Traceback (most recent call last): 
2014-02-28T01:55:28.171442+00:00 app[web.1]:  worker.init_process() 
2014-02-28T01:55:28.171442+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process 
2014-02-28T01:55:28.171442+00:00 app[web.1]:  self.wsgi = self.app.wsgi() 
2014-02-28T01:55:28.171442+00:00 app[web.1]:  return self.load_wsgiapp() 
2014-02-28T01:55:28.171688+00:00 app[web.1]: Traceback (most recent call last): 
2014-02-28T01:55:28.171688+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp 
2014-02-28T01:55:28.171688+00:00 app[web.1]:  return util.import_app(self.app_uri) 
2014-02-28T01:55:28.171442+00:00 app[web.1]:  self.callable = self.load() 
2014-02-28T01:55:28.171688+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app 
2014-02-28T01:55:28.171688+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process 
2014-02-28T01:55:28.171876+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp 
2014-02-28T01:55:28.171688+00:00 app[web.1]:  self.wsgi = self.app.wsgi() 
2014-02-28T01:55:28.171688+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker 
2014-02-28T01:55:28.171876+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi 
2014-02-28T01:55:28.171876+00:00 app[web.1]:  self.callable = self.load() 
2014-02-28T01:55:28.171688+00:00 app[web.1]:  __import__(module) 
2014-02-28T01:55:28.171876+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load 
2014-02-28T01:55:28.171688+00:00 app[web.1]:  worker.init_process() 
2014-02-28T01:55:28.171876+00:00 app[web.1]:  __import__(module) 
2014-02-28T01:55:28.171876+00:00 app[web.1]: ImportError: No module named hellodjango.wsgi 
2014-02-28T01:55:28.171876+00:00 app[web.1]: 2014-02-28 01:55:28 [7] [INFO] Worker exiting (pid: 7) 
2014-02-28T01:55:28.171876+00:00 app[web.1]:  return self.load_wsgiapp() 
2014-02-28T01:55:28.171876+00:00 app[web.1]:  return util.import_app(self.app_uri) 
2014-02-28T01:55:28.171688+00:00 app[web.1]: ImportError: No module named hellodjango.wsgi 
2014-02-28T01:55:28.171876+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app 
2014-02-28T01:55:28.302686+00:00 app[web.1]: 2014-02-28 01:55:28 [2] [INFO] Reason: Worker failed to boot. 
2014-02-28T01:55:28.301829+00:00 app[web.1]: 2014-02-28 01:55:28 [2] [INFO] Shutting down: Master 
2014-02-28T01:55:29.730749+00:00 heroku[web.1]: Process exited with status 3 
2014-02-28T01:56:03.044535+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=whispering-waters-3343.herokuapp.com request_id=1f164238-99f1-4ba8-8761-7269025f0322 fwd="173.164.141.93" dyno= connect= service= status=503 bytes= 
2014-02-28T01:55:14.121881+00:00 heroku[web.1]: State changed from crashed to starting 
2014-02-28T01:55:21.980705+00:00 heroku[web.1]: State changed from starting to crashed 
2014-02-28T01:55:21.981905+00:00 heroku[web.1]: State changed from crashed to starting 
2014-02-28T01:55:29.742422+00:00 heroku[web.1]: State changed from starting to crashed 
2014-02-28T01:59:40.421794+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=whispering-waters-3343.herokuapp.com request_id=349cce4c-69af-42ee-a19d-5c35d6713390 fwd="173.164.141.93" dyno= connect= service= status=503 bytes= 
2014-02-28T01:59:40.682076+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=whispering-waters-3343.herokuapp.com request_id=f998d494-1026-45b3-9c44-2cfb19f45b14 fwd="173.164.141.93" dyno= connect= service= status=503 bytes= 
+0

你可以發佈你的'Procfile'和'wsgi.py'嗎? –

+0

Procfile:'web:gunicorn hellodjango.wsgi' –

+0

wsgi.py:很確定沒有改變從原來的Django設置。 '進口OS os.environ.setdefault( 「DJANGO_SETTINGS_MODULE」, 「mysite.settings」) 從django.core.wsgi進口get_wsgi_application 從dj_static進口保鮮 應用=保鮮(get_wsgi_application())' –

回答

2

這個問題似乎是這樣的:「導入錯誤:沒有模塊名爲hellodjango.wsgi」

從您發佈的信息,這聽起來像「hellodjango」不項目名稱和WSGI應用程序,因此對hellodjango.wsgi的引用失敗。

我猜這個名字應該是你的項目結構和wsgi.py文件中的「mysite」。

編輯:你的procfile應該調用.wsgi(這是默認的django行爲)。

請在評論中發表最多什麼是您用來啓動此項目的項目名稱。

+0

評論隱藏以上 - 我編輯Procfile到網站:gunicorn mysite.wsgi,推送到GitHub,推到Heroku,重新啓動heroku,heroku日誌說「ImportError:沒有名爲mysite.wsgi的模塊」。完整heroku日誌:(https://gist.github.com/amyrlam/9266660) –

+0

另外這裏是我的領班開始,如果有幫助:https://gist.github.com/amyrlam/9266757 –

+0

更新的答案,基本上,除非你在某處改變了這個地方,否則你需要在proc文件中調用 .wsgi。 – Sologoub

1

更新procfile,將mysite.wsgi替換爲應用程序的正確名稱,它將運行。

你可能通過一個教程來到這裏,改變這個信息並不明顯。

+0

請不要發佈「謝謝」答案。 – JasonMArcher