AttributeError:'tuple'对象没有属性'insert'

时间:2013-03-13 09:39:40

标签: django mongodb mongoengine django-nonrel django-mongodb-engine

我已从http://www.django-mongodb.org/topics/setup.html

安装了以下内容

django-nonrel

djangotoolbox

mongodb-engine

安装后我尝试使用python manage.py runserver

运行我的程序

它显示如下错误,

Validating models...

Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1655450>>
Traceback (most recent call last):
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 92, in inner_run
    self.validate(display_num_errors=True)
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/core/management/base.py", line 280, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/core/management/validation.py", line 28, in get_validation_errors
    from django.db import models, connection
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/db/utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/db/utils.py", line 27, in load_backend
    return import_module('.base', backend_name)
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/sakeer/workspace/entevirtual/lib/python2.7/site-packages/django_mongodb_engine-0.4.0-py2.7.egg/django_mongodb_engine/__init__.py", line 13, in <module>

AttributeError: 'tuple' object has no attribute 'insert'

我正在使用Django 1.5和python 2.7

提前致谢

1 个答案:

答案 0 :(得分:3)

django-mongodb-engine由于某种原因预计settings.INSTALLED_APPS会成为一个列表。

你必须改变你的

INSTALLED_APPS = (
   .. apps ..
)

INSTALLED_APPS = [
   .. apps ..
]

这完全是django-mongodb-engine的错,他们应该心疼。

他们有this issue七个月并且没有任何顾虑。