【发布时间】:2020-07-09 16:28:11
【问题描述】:
我想在 MondoDB shell 中的 django 中导入模型。 我在 Django 中的模型类
class User(models.Model):
name = models.CharField(max_length=20)
我在 mongo shell 中使用它
from app.models import User
错误:
[js] SyntaxError: missing ; before statement @(shell):1:6
【问题讨论】:
-
据我所知,您无法导入 Django 模型。毕竟这些都是 Python 对象,而 mongo db 只是数据库上的一个外壳。
标签: python-3.x django mongodb djongo