我正在尝试在运行git push heroku master
之后在Heroku上部署我的Django应用程序,然后heroku open
因异常而失败。
heroku logs
显示:
[2018-01-21 05:25:17 +0000] [10] [ERROR] Exception in worker process
2018-01-21T05:25:17.928006+00:00 app[web.1]: Traceback (most recent call last):
2018-01-21T05:25:17.928007+00:00 app[web.1]: File "/app/.heroku/python /lib/python2.7/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
2018-01-21T05:25:17.928009+00:00 app[web.1]: worker.init_process()
2018-01-21T05:25:17.928010+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
2018-01-21T05:25:17.928011+00:00 app[web.1]: self.load_wsgi()
2018-01-21T05:25:17.928012+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
2018-01-21T05:25:17.928013+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2018-01-21T05:25:17.928014+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2018-01-21T05:25:17.928015+00:00 app[web.1]: self.callable = self.load()
2018-01-21T05:25:17.928016+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2018-01-21T05:25:17.928016+00:00 app[web.1]: return self.load_wsgiapp()
2018-01-21T05:25:17.928018+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2018-01-21T05:25:17.928018+00:00 app[web.1]: return util.import_app(self.app_uri)
2018-01-21T05:25:17.928019+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
2018-01-21T05:25:17.928020+00:00 app[web.1]: __import__(module)
2018-01-21T05:25:17.928021+00:00 app[web.1]: File "/app/mysite/wsgi.py", line 16, in <module>
2018-01-21T05:25:17.928023+00:00 app[web.1]: application = get_wsgi_application()
2018-01-21T05:25:17.928023+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2018-01-21T05:25:17.928024+00:00 app[web.1]: django.setup(set_prefix=False)
2018-01-21T05:25:17.928025+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
2018-01-21T05:25:17.928026+00:00 app[web.1]: apps.populate(settings.INSTALLED_APPS)
2018-01-21T05:25:17.928027+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
2018-01-21T05:25:17.928028+00:00 app[web.1]: app_config = AppConfig.create(entry)
2018-01-21T05:25:17.928029+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/apps/config.py", line 94, in create
2018-01-21T05:25:17.928030+00:00 app[web.1]: module = import_module(entry)
2018-01-21T05:25:17.928031+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
2018-01-21T05:25:17.928032+00:00 app[web.1]: __import__(name)
2018-01-21T05:25:17.928033+00:00 app[web.1]: ImportError: No module named taggit
2018-01-21T05:25:17.928163+00:00 app[web.1]: [2018-01-21 05:25:17 +0000] [10] [INFO] Worker exiting (pid: 10)
2018-01-21T05:25:17.962433+00:00 app[web.1]: [2018-01-21 05:25:17 +0000] [4] [INFO] Shutting down: Master
2018-01-21T05:25:17.962513+00:00 app[web.1]: [2018-01-21 05:25:17 +0000] [4] [INFO] Reason: Worker failed to boot.
2018-01-21T05:25:18.038138+00:00 heroku[web.1]: Process exited with status 3
2018-01-21T05:25:18.046911+00:00 heroku[web.1]: State changed from starting to crashed
我无法弄清楚是什么导致了这个错误,请有人指导我这个。
答案 0 :(得分:0)
ImportError: No module named taggit
:Python进程无法找到taggit
模块。我假设你使用的是django-taggit:https://pypi.python.org/pypi/django-taggit。
通常,Heroku接受requirements.txt
作为依赖项列表。在文件中添加一行django-taggit~=0.22.2
,提交它,然后推送到Heroku。