Heroku NameError:name' application'没有定义

时间:2014-07-04 18:14:34

标签: django heroku gunicorn procfile

我试图将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

2 个答案:

答案 0 :(得分:0)

它说应用程序未找到。好好尝试换枪炮

  

web:gunicorn YourProject.wsgi

答案 1 :(得分:0)

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

web: gunicorn app.wsgi --pythonpath app --log-file -