Django,将默认数据库引擎更改为djongo时无法迁移

时间:2019-09-10 09:49:46

标签: django python-3.x mongodb djongo

我是django的新手,当我将默认的sqlite3引擎更改为“ djongo”时,遇到了无法移植更改的问题。

我正在使用ubuntu服务器,并且已完成以下步骤:

$ pip3 install djongo


# setup djongo
DATABASES = {
    'default': {
        'ENGINE': 'djongo',
        'NAME': 'zoo',
    }
}

我不知道问题出在哪里,但是当我迁移更改时,我收到以下错误消息:

File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/karam/.local/lib/python3.5/site-packages/djongo/base.py", line 12, in <module>
from .cursor import Cursor
File "/home/karam/.local/lib/python3.5/site-packages/djongo/cursor.py", line 2, in <module>
from .sql2mongo.query import Result
File "/home/karam/.local/lib/python3.5/site-packages/djongo/sql2mongo/__init__.py", line 34
self.alias2op: typing.Dict[str, SQLToken] = alias2op
SyntaxError: invalid syntax

任何想法我错过了什么?

0 个答案:

没有答案