我有一个在 Heroku 上成功运行并使用 mongodb 引擎的 Django 应用程序。一下子,我再也推不动了。它似乎不再识别 django_mongodb_engine 模块。我什至将所有更改恢复到上次运行的版本,但它仍然是一样的。我怀疑版本冲突左右,但不知道如何解决它。
这是我得到的错误:
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
我特别困惑,因为我还原了所有更改。正是这个具有相同配置的代码运行完美(并且仍然在我的生产服务器上运行),只是推送不起作用。
谢谢西蒙