2012-10-05 119 views
0

我试图在Heroku上部署此应用程序https://bitbucket.org/hybird/creme_crm-1.2。 我跟着引导https://devcenter.heroku.com/articles/django 该应用程序使用Django开发服务器或gunicorn正常工作在本地服务器上用“工头开始”,但未能在Heroku上,出现此错误:Django应用程序在本地正常工作,但在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" 

回答

0

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

0

错误说你缺少一个模块: creme_core

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

确保你有一个requirments.txt文件(PIP冻结文件):这是在文档中下冻结PIP here

+0

我有一个requirements.txt文件,但creme_core已经在我推送到Heroku的源代码中,它是Web应用程序的一部分。正如我所说的应用程序在本地主机上正常工作。 – madmed

+0

经过一番研究后,它看起来像一个与您的要求无关的错误。这是更多的本地变量配置错误。具体来说,它看起来像是与您的设置文件中的上下文处理器var有关 –

相关问题