1

我正在尝试将 django 应用程序部署到 heroku,但它一直在崩溃。有谁知道我做错了什么?这是我的Procfile:

web: python app/manage.py collectstatic --noinput; gunicorn --workers=4 --bind=0.0.0.0:$PORT app.settings

这是我的heroku日志中的一个片段:

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
  File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 456, in spawn_worker
    self.wsgi = self.app.wsgi()
    app = eval(obj, mod.__dict__)
  File "<string>", line 1, in <module>
  File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 101, in wsgi
  File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 24, in load
    self.callable = self.load()
    return util.import_app(self.app_uri)
NameError: name 'application' is not defined
2014-07-04 17:58:23 [4] [INFO] Starting gunicorn 0.13.4
2014-07-04 17:58:23 [10] [ERROR] Exception in worker process:
    worker.init_process()
  File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 250, in import_app
2014-07-04 17:58:23 [9] [INFO] Booting worker with pid: 9
2014-07-04 17:58:23 [10] [INFO] Worker exiting (pid: 10)
2014-07-04 17:58:23 [4] [INFO] Listening at: http://0.0.0.0:36148 (4)
2014-07-04 17:58:23 [7] [INFO] Booting worker with pid: 7
4

2 回答 2

0

在做了几件事后,我解决了自己的问题,包括升级我的 django 安装并将我的 procfile 更改为:

web: gunicorn app.wsgi --pythonpath app --log-file - 
于 2014-07-12T19:26:54.640 回答
0

它说找不到应用程序。好吧尝试改变gunicorn

网站:gunicorn YourProject.wsgi

于 2014-07-08T04:50:27.247 回答