Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 古尼科恩·赫罗库_Python_Django_Heroku_Gunicorn - Fatal编程技术网

Python 古尼科恩·赫罗库

Python 古尼科恩·赫罗库,python,django,heroku,gunicorn,Python,Django,Heroku,Gunicorn,我在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 [s

我在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.
然后,我的服务器掉了。
请帮帮我。

您的错误与您在PROC文件中所说的不匹配。请复制并粘贴确切的设置。对于deploy django项目,Procfile应该是web:gunicorn project.wsgiAs,我用Procfile web:python manage.py runserver 0.0.0.0:$PORT-noreload在开发模式下工作正常。但是procfileweb:gunicorn losbarkitos.wsgi给了我上面描述的错误。基本上,没有名为losbarkitos的模块。我不明白为什么会这样。我无法将我的应用程序投入生产。