2013-04-20 70 views
2

我有一個Django應用程序,成功地在Heroku上運行並使用mongodb引擎。突然之間,我無法再推它了。它似乎不再承認django_mongodb_engine模塊。我甚至恢復了上次運行版本的所有更改,但仍然相同。我懷疑有版本衝突,但無法弄清楚如何解決這個問題。「'django_mongodb_engine'不是可用的數據庫後端」當推送到Heroku

這是我得到的錯誤:

Traceback (most recent call last): 
    File "manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 429, in execute_from_command_line 
    utility.execute() 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv 
    self.execute(*args, **options.__dict__) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute 
    output = self.handle(*args, **options) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 351, in handle 
    return self.handle_noargs(**options) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/shell.py", line 46, in handle_noargs 
    from django.db.models.loading import get_models 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/db/__init__.py", line 78, in <module> 
    connection = connections[DEFAULT_DB_ALIAS] 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/db/utils.py", line 93, in __getitem__ 
    backend = load_backend(db['ENGINE']) 
    File "/app/.heroku/python/lib/python2.7/site-packages/django/db/utils.py", line 51, in load_backend 
    raise ImproperlyConfigured(error_msg) 
django.core.exceptions.ImproperlyConfigured: 'django_mongodb_engine' isn't an available database backend. 
Try using django.db.backends.XXX, where XXX is one of: 
    'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3' 
Error was: No module named utils 

而這些都是從requirements.txt重要的部分:

hg+https://bitbucket.org/wkornewald/django-nonrel 
git+https://github.com/django-nonrel/mongodb-engine 
hg+https://bitbucket.org/wkornewald/djangotoolbox 

pymongo==2.2.1 
pytz==2012d 

我特別困惑,因爲我恢復所有更改。具有相同配置的這段代碼完全運行(並且仍然在我的生產服務器上),只是推送不起作用。

感謝 西蒙

+0

我想你要找的路線是:'錯誤:沒有模塊名爲utils'。可能會有一個導入blah.utils的地方導致錯誤。 – 2013-04-20 03:05:36

回答

0

當然,只是當我問,所以我想出答案:-)

我不知道到底爲什麼,但確定的是我要檢查的確切版本解決了這個問題。

所以requirements.txt現在看起來是這樣的:

-e hg+http://bitbucket.org/wkornewald/[email protected]#egg=Django-dev 
-e git+https://github.com/django-nonrel/[email protected]#egg=django_mongodb_engine-dev 
-e hg+https://bitbucket.org/wkornewald/[email protected]#egg=djangotoolbox-dev 

pymongo==2.2.1 
pytz==2012d 
相關問題