我在django做了一个项目,我住在heroku . 当我使用Procfile“web:python manage.py runserver 0.0.0.0:$PORT --noreload”进入开发模式时没有问题,一切正常 .

但是当我想用Procfile“web:losbarkitos gunicorn:application --log-file = - ”将项目移动到 生产环境 时,服务器崩溃并给我以下错误:

2015-03-22T10: 02: 08.673466 + 00: 00 heroku [site.1]: State changed from up to starting
2015-03-22T10: 02: 12.874811 + 00: 00 heroku [site.1]: Stopping All Processes With SIGTERM
2015-03-22T10: 02: 14.621497 + 00: 00 heroku [site.1]: Process exited with status 143
2015-03-22T10: 02: 20.455989 + 00: 00 heroku [site.1]: Starting process command `With gunicorn losbarkitos: application --log-file = -`
2015-03-22T10: 02: 21.924838 + 00: 00 app [site.1]: [03/22/2015 10:02:21 +0000] [3] [INFO] Listening at: http://0.0.0.0 : 5895 (3)
2015-03-22T10: 02: 21.924919 + 00: 00 app [site.1]: [03/22/2015 10:02:21 +0000] [3] [INFO] Using worker: sync
2015-03-22T10: 02: 21.933902 + 00: 00 app [site.1]: [03/22/2015 10:02:21 +0000] [9] [INFO] Booting worker with pid: 9
2015-03-22T10: 02: 21.924084 + 00: 00 app [site.1]: [03/22/2015 10:02:21 +0000] [3] [INFO] Starting gunicorn 19.3.0
2015-03-22T10: 02: 21.937588 + 00: 00 app [site.1]: [03/22/2015 10:02:21 +0000] [9] [ERROR] Exception in worker process:
2015-03-22T10: 02: 21.937591 + 00: 00 app [site.1]: Traceback (most recent call last):
2015-03-22T10: 02: 21.937593 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
2015-03-22T10: 02: 21.937594 + 00: 00 app [site.1]: worker.init_process ()
2015-03-22T10: 02: 21.937595 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py" line 118, in init_process
2015-03-22T10: 02: 21.937597 + 00: 00 app [site.1]: self.wsgi = self.app.wsgi ()
2015-03-22T10: 02: 21.937598 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 67, in wsgi
2015-03-22T10: 02: 21.937599 + 00: 00 app [site.1]: self.callable = self.load ()
2015-03-22T10: 02: 21.937600 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 65, in load
2015-03-22T10: 02: 21.937602 + 00: 00 app [site.1]: return self.load_wsgiapp ()
2015-03-22T10: 02: 21.937603 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 52, in load_wsgiapp
2015-03-22T10: 02: 21.937604 + 00: 00 app [site.1]: return util.import_app (self.app_uri)
2015-03-22T10: 02: 21.937605 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
2015-03-22T10: 02: 21.937606 + 00: 00 app [site.1]: __import __ (module)
2015-03-22T10: 02: 21.937608 + 00: 00 app [site.1]: ImportError: No module named losbarkitos
2015-03-22T10: 02: 21.937610 + 00: 00 app [site.1]: Traceback (most recent call last):
2015-03-22T10: 02: 21.937611 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
2015-03-22T10: 02: 21.937612 + 00: 00 app [site.1]: worker.init_process ()
2015-03-22T10: 02: 21.937613 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py" line 118, in init_process
2015-03-22T10: 02: 21.937615 + 00: 00 app [site.1]: self.wsgi = self.app.wsgi ()
2015-03-22T10: 02: 21.937616 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 67, in wsgi
2015-03-22T10: 02: 21.937617 + 00: 00 app [site.1]: self.callable = self.load ()
2015-03-22T10: 02: 21.937618 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 65, in load
2015-03-22T10: 02: 21.937619 + 00: 00 app [site.1]: return self.load_wsgiapp ()
2015-03-22T10: 02: 21.937621 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 52, in load_wsgiapp
2015-03-22T10: 02: 21.937622 + 00: 00 app [site.1]: return util.import_app (self.app_uri)
2015-03-22T10: 02: 21.937623 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
2015-03-22T10: 02: 21.937624 + 00: 00 app [site.1]: __import __ (module)
2015-03-22T10: 02: 21.937625 + 00: 00 app [site.1]: ImportError: No module named losbarkitos
2015-03-22T10: 02: 21.937677 + 00: 00 app [site.1]: [03/22/2015 10:02:21 +0000] [9] [INFO] Worker exiting (pid: 9)
2015-03-22T10: 02: 21.967260 + 00: 00 app [site.1]: Traceback (most recent call last):
2015-03-22T10: 02: 21.967269 + 00: 00 app [site.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2015-03-22T10: 02: 21.967322 + 00: 00 app [site.1]: sys.exit (run ())
2015-03-22T10: 02: 21.967350 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 74, in run
2015-03-22T10: 02: 21.967389 + 00: 00 app [site.1]: WSGIApplication ("% (prog) s [OPTIONS] [APP_MODULE]") run ().
2015-03-22T10: 02: 21.967410 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 189, in run
2015-03-22T10: 02: 21.967460 + 00: 00 app [site.1]: super (Application, self) .run ()
2015-03-22T10: 02: 21.967480 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 72, in run
2015-03-22T10: 02: 21.967512 + 00: 00 app [site.1]: Arbiter (self) .run ()
2015-03-22T10: 02: 21.967532 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 174, in run
2015-03-22T10: 02: 21.967580 + 00: 00 app [site.1]: self.manage_workers ()
2015-03-22T10: 02: 21.967600 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
2015-03-22T10: 02: 21.967677 + 00: 00 app [site.1]: self.spawn_workers ()
2015-03-22T10: 02: 21.967698 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 541, in spawn_workers
2015-03-22T10: 02: 21.967783 + 00: 00 app [site.1]: time.sleep (0.1 * random.random ())
2015-03-22T10: 02: 21.967803 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 214, in handle_chld
2015-03-22T10: 02: 21.967850 + 00: 00 app [site.1]: self.reap_workers ()
2015-03-22T10: 02: 21.967870 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
2015-03-22T10: 02: 21.967945 + 00: 00 app [site.1]: raise HaltServer (reason, self.WORKER_BOOT_ERROR)
2015-03-22T10: 02: 21.968015 + 00: 00 app [site.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2015-03-22T10: 02: 22.704918 + 00: 00 heroku [site.1]: Process exited with status 1
2015-03-22T10: 02: 22.716342 + 00: 00 heroku [site.1]: State changed from crashed to starting
2015-03-22T10: 02: 22.715657 + 00: 00 heroku [site.1]: State changed from starting to crashed
2015-03-22T10: 02: 39.286418 + 00: 00 heroku [site.1]: Starting process command `With gunicorn losbarkitos: application --log-file = -`
2015-03-22T10: 02: 41.086157 + 00: 00 app [site.1]: [03/22/2015 10:02:41 +0000] [3] [INFO] Listening at: http://0.0.0.0 : 58931 (3)
2015-03-22T10: 02: 41.086245 + 00: 00 app [site.1]: [03/22/2015 10:02:41 +0000] [3] [INFO] Using worker: sync
2015-03-22T10: 02: 41.095593 + 00: 00 app [site.1]: [03/22/2015 10:02:41 +0000] [9] [INFO] Booting worker with pid: 9
2015-03-22T10: 02: 41.085443 + 00: 00 app [site.1]: [03/22/2015 10:02:41 +0000] [3] [INFO] Starting gunicorn 19.3.0
2015-03-22T10: 02: 41.099564 + 00: 00 app [site.1]: [03/22/2015 10:02:41 +0000] [9] [ERROR] Exception in worker process:
2015-03-22T10: 02: 41.099567 + 00: 00 app [site.1]: Traceback (most recent call last):
2015-03-22T10: 02: 41.099570 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
2015-03-22T10: 02: 41.099572 + 00: 00 app [site.1]: worker.init_process ()
2015-03-22T10: 02: 41.099575 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py" line 118, in init_process
2015-03-22T10: 02: 41.099577 + 00: 00 app [site.1]: self.wsgi = self.app.wsgi ()
2015-03-22T10: 02: 41.099579 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 67, in wsgi
2015-03-22T10: 02: 41.099581 + 00: 00 app [site.1]: self.callable = self.load ()
2015-03-22T10: 02: 41.099583 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 65, in load
2015-03-22T10: 02: 41.099586 + 00: 00 app [site.1]: return self.load_wsgiapp ()
2015-03-22T10: 02: 41.099588 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 52, in load_wsgiapp
2015-03-22T10: 02: 41.099589 + 00: 00 app [site.1]: return util.import_app (self.app_uri)
2015-03-22T10: 02: 41.099592 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
2015-03-22T10: 02: 41.099594 + 00: 00 app [site.1]: __import __ (module)
2015-03-22T10: 02: 41.099596 + 00: 00 app [site.1]: ImportError: No module named losbarkitos
2015-03-22T10: 02: 41.099599 + 00: 00 app [site.1]: Traceback (most recent call last):
2015-03-22T10: 02: 41.099601 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
2015-03-22T10: 02: 41.099603 + 00: 00 app [site.1]: worker.init_process ()
2015-03-22T10: 02: 41.099605 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py" line 118, in init_process
2015-03-22T10: 02: 41.099607 + 00: 00 app [site.1]: self.wsgi = self.app.wsgi ()
2015-03-22T10: 02: 41.099610 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 67, in wsgi
2015-03-22T10: 02: 41.099612 + 00: 00 app [site.1]: self.callable = self.load ()
2015-03-22T10: 02: 41.099614 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 65, in load
2015-03-22T10: 02: 41.099616 + 00: 00 app [site.1]: return self.load_wsgiapp ()
2015-03-22T10: 02: 41.099618 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 52, in load_wsgiapp
2015-03-22T10: 02: 41.099619 + 00: 00 app [site.1]: return util.import_app (self.app_uri)
2015-03-22T10: 02: 41.099621 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 355, in import_app
2015-03-22T10: 02: 41.099622 + 00: 00 app [site.1]: __import __ (module)
2015-03-22T10: 02: 41.099624 + 00: 00 app [site.1]: ImportError: No module named losbarkitos
2015-03-22T10: 02: 41.099664 + 00: 00 app [site.1]: [03/22/2015 10:02:41 +0000] [9] [INFO] Worker exiting (pid: 9)
2015-03-22T10: 02: 41.127185 + 00: 00 app [site.1]: Traceback (most recent call last):
2015-03-22T10: 02: 41.127196 + 00: 00 app [site.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2015-03-22T10: 02: 41.127233 + 00: 00 app [site.1]: sys.exit (run ())
2015-03-22T10: 02: 41.127264 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py" line 74, in run
2015-03-22T10: 02: 41.127307 + 00: 00 app [site.1]: WSGIApplication ("% (prog) s [OPTIONS] [APP_MODULE]") run ().
2015-03-22T10: 02: 41.127331 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 189, in run
2015-03-22T10: 02: 41.127387 + 00: 00 app [site.1]: super (Application, self) .run ()
2015-03-22T10: 02: 41.127410 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py" line 72, in run
2015-03-22T10: 02: 41.127446 + 00: 00 app [site.1]: Arbiter (self) .run ()
2015-03-22T10: 02: 41.127469 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 174, in run
2015-03-22T10: 02: 41.127521 + 00: 00 app [site.1]: self.manage_workers ()
2015-03-22T10: 02: 41.127550 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 477, in manage_workers
2015-03-22T10: 02: 41.127650 + 00: 00 app [site.1]: self.spawn_workers ()
2015-03-22T10: 02: 41.127655 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 541, in spawn_workers
2015-03-22T10: 02: 41.127767 + 00: 00 app [site.1]: time.sleep (0.1 * random.random ())
2015-03-22T10: 02: 41.127786 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 214, in handle_chld
2015-03-22T10: 02: 41.127840 + 00: 00 app [site.1]: self.reap_workers ()
2015-03-22T10: 02: 41.127868 + 00: 00 app [site.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 459, in reap_workers
2015-03-22T10: 02: 41.127951 + 00: 00 app [site.1]: raise HaltServer (reason, self.WORKER_BOOT_ERROR)
2015-03-22T10: 02: 41.128059 + 00: 00 app [site.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2015-03-22T10: 02: 41.876066 + 00: 00 heroku [site.1]: Process exited with status 1
2015-03-22T10: 02: 41.912836 + 00: 00 heroku [site.1]: State changed from starting to crashed.

然后,我的服务器掉了下来 . 请帮帮我 .