0

我正在尝试在 Heroku 上部署此应用程序https://bitbucket.org/hybird/creme_crm-1.2 。我按照指南https://devcenter.heroku.com/articles/django 该应用程序在本地服务器上使用 django 开发服务器或带有“工头启动”的 gunicorn 运行良好,但在 Heroku 上失败并出现以下错误:

[INFO] Starting gunicorn 0.14.6
Starting gunicorn 0.14.6
[INFO] Listening at: http://0.0.0.0:16635 (2)
Listening at: http://0.0.0.0:16635 (2)
[INFO] Using worker: sync
Using worker: sync
[INFO] Booting worker with pid: 5
Booting worker with pid: 5
    response = view_func(request, *args, **kwargs)
  File "/app/.heroku/venv/lib/python2.7/site-packages/django/views/decorators/cache.py", line 79, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/app/.heroku/venv/lib/python2.7/site-packages/django/contrib/auth/views.py", line 69, in login
    context_instance=RequestContext(request, current_app=current_app))
  File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/context.py", line 172, in __init__
    for processor in get_standard_processors() + processors:
  File "/app/.heroku/venv/lib/python2.7/site-packages/django/template/context.py", line 150, in get_standard_processors
    raise ImproperlyConfigured('Error importing request processor module %s: "%s"' % (module, e))
ImproperlyConfigured: Error importing request processor module creme_core.context_processors: "No module named creme"
4

2 回答 2

0

该错误表明您缺少一个模块:creme_core

当您将项目部署到 heroku 时,heroku 使用 pip freeze 需求文件,其中包含项目中的所有模块。Heroku 在部署应用程序时会下载需求文件中的所有模块。

确保你有一个 requirments.txt 文件(pip freeze 文件):它在 pip freeze 下的文档

于 2012-10-05T17:42:04.703 回答
0

问题是我从应用程序文件夹中推送到heroku。假设我的应用程序位于 creme 文件夹中。我必须创建一个包含 creme 文件夹、requirements.txt 和 Procfile 的文件夹。错误是我将需求和 Procfile 放在 creme 文件夹中,它适用于 localhost 但不适用于 Heroku。

于 2012-10-08T10:48:26.950 回答