问题标签 [django-mongodb-engine]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
166 浏览

python - 在 django 中使用 django mongodb 引擎在 gridfs 中添加元数据字段

如何在 gridfs 的元数据中添加字段以及默认字段?在 models.py 中使用以下代码

它只给出了 gridfs 元数据中的默认字段

如何在此元数据中添加额外字段?

0 投票
2 回答
2443 浏览

django - 当我将视图包含在 django Mongoengine Web 服务 url.py 文件中时,为什么会出现 base_name 属性错误?

我正在尝试使用 django-rest-framework-mongoengine 来构建使用 Django 和 mongodb 的 Web 服务。

当我包含一个列出我的 Document 类型对象的 url 时出现错误。

我的模型文件是

我的看法是

我的网址文件是

我的序列化程序是

执行 runserver 时出现以下错误

我尝试了不同的视图类型,但都是相同的错误。任何帮助是极大的赞赏....

我在用

这是完整的堆栈

0 投票
4 回答
86787 浏览

django - 找不到命令“git”-windows

我正在尝试使用我的 python django 应用程序安装 mongodb_engine,但是我收到了这个错误

我正在从 mongodb 文档中尝试这个命令。http://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html

我相信这里的 git 会导致问题,因为项目存储在 git repo 中。有没有办法安装 git 来运行这个 pip 命令?我尝试了多个来源,但无法使其正常工作。

0 投票
7 回答
14681 浏览

python - django.core.exceptions.ImproperlyConfigured: 'django_mongodb_engine' 不是可用的数据库后端

我无法正确运行 django mongo 引擎。

我在 settings.py 中的数据库条目是

我的点冻结结果是

运行时出错

任何建议如何解决这个问题。

0 投票
1 回答
249 浏览

django - 使用 django 1.8 或任何其他使用 MongoDB 的方式配置 django_mongodb_engine

我已经用 django 1.6 版本配置了 django_mongodb_engine 但我无法用 1.8 版本配置它。我已经使用了本网站 https://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html上给出的步骤

0 投票
1 回答
848 浏览

python - Django MongoDB 引擎支持哪些版本的 Django?

Django MongoDB Engine 的维护和支持是否仍然有效?我在网上搜索了一下,发现 Django MongoDB Engine 的原作者已经退出了这个项目。我想知道它是否支持 Django 1.8。如果没有,我会切换到另一个 mongo ORM,例如 mongoengine。相关问题(没有答案):使用 django 1.8 或任何其他方式使用 MongoDB 配置 django_mongodb_engine

0 投票
1 回答
1589 浏览

python - How to use lookup operator icontains in raw query of django mongodb engine?

I am using django-mongodb-engine

Here is used mondodbmanager to use raw query.

This is not working as expect. So how can i use contains lookup type on embedded fields?

If there is other workaround except then mongodbmanager will be also acceptable like below.

0 投票
1 回答
1147 浏览

python - pip install django-mongodb-engine 错误:“命令“python setup.py egg_info”失败,错误代码为 1”

我希望这里有人可以帮助我,因为我真的为此苦苦挣扎了大约 12 个小时以上。

我尝试使用 Django 和 MongoDb 使用以下包说明http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/

哪个要我安装

  1. pip install ***ps://bitbucket.org/wkornewald/django-nonrel/get/tip.tar.gz
  2. pip install ***ps://bitbucket.org/wkornewald/djangotoolbox/get/tip.tar.gz
  3. pip install ***ps://github.com/django-nonrel/mongodb-engine/tarball/master

我管理了前 2 个,但是当我尝试安装 mongodb-engine 时出现以下错误。我尝试了各种形式来安装它,比如“ pip install django-mongodb-engine

我收到以下错误:

"C:\Users\Burnie\Anaconda3\Scripts>pip install django-mongodb-engine 收集 django-mongodb-engine 使用缓存的 django-mongodb-engine-0.6.0.tar.gz 命令 python setup.py egg_info 的完整输出:回溯(最近一次调用):文件“”,第 20 行,文件“C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-engine\setup.py”,第 3 行,在 import django_mongodb_engine 作为 distmeta 文件“C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-engine\django_mongodb_engine__init__.py”,第 12 行,从 django.conf 导入设置文件“ C:\Users\Burnie\Anaconda3\lib\site-packages\django\conf__init__.py",第 88 行,ImportError 除外,e: ^ SyntaxError:无效的语法


命令“python setup.py egg_info”在 C:\Users\Burnie\AppData\Local\Temp\pip-build-ntl4z4sp\django-mongodb-engine 中失败,错误代码为 1”

MySystem:
Windows 7,
Anaconda(作为 python 发行版)64 位

我希望有人可以帮助我。

0 投票
2 回答
11054 浏览

django - 直接在django中使用pymongo

我正在使用 Django 和 MongoDB 构建一个网站。我们可以使用 2 个流行的 API 框架来连接DjangoMongoDB一个是mongoengine,另一个是django-mongodb-engine

因为最新mongoengine的 Django 不再支持Document,并且django-mongodb-engine需要另一个django-nonrel包,这使得开发环境有点复杂。

我想知道,如果我可以使用Pymongo连接DjangoMongoDB直接。

有没有相同经历的可以分享一下?以及如何setting.py在 Django 中设置数据库以公开数据库?

0 投票
2 回答
1285 浏览

django - 尝试运行服务器时出现 SchemaEditor 错误

我有一个 MongoDB 后端,并且在python3 manage.py runserver.

回溯(最后一次调用):文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/utils/autoreload.py”,第 225 行,在包装器 fn(*args, **kwargs) 文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/core/management/commands/runserver.py ”,第 112 行,inner_run self.check_migrations() 文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/core/management/commands/runserver .py”,第 164 行,在 check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) 文件“hct.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/db/ migrations/executor.py”,第 19 行,在init中 self.loader = MigrationLoader(self.connection)文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/db/migrations/loader.py”,第 47 行,在初始化中 self.build_graph() 文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/db/migrations/loader.py”,第 182 行,在 build_graph self.applied_migrations = recorder.applied_migrations() 文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/db/migrations/recorder.py”,行59、在applied_migrations self.ensure_schema()文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/db/migrations/recorder.py”中,行52、在以self.connection.schema_editor()为编辑器的ensure_schema中:文件“hct/.local/lib/python3.4/site-packages/Django-1.8.3-py3.4.egg/django/db/backends/ base/base.py",第 503 行,在 schema_editor '该数据库包装器的 SchemaEditorClass 属性仍然是 None') NotImplementedError:这个数据库包装器的 SchemaEditorClass 属性仍然是 None

我在 settings.py 中做了以下更改 -

在已安装的应用程序中,添加

'djangotoolbox',

settings.py 中的 db 配置 -

}

我在站点包中安装了以下 3 个 mongodb 包

如果以下情况相关,

  • 我的 models.py 还没有完全填充。
  • 如果我跑django-admin runserver --settings = myproject.settings,它会提高

ImportError:没有名为“myproject”的模块

项目文件夹如下-

我的项目

  • 我的项目

    • 设置.py
    • wsgi.py
  • 我的应用

    管理.py

我不确定是否需要从https://github.com/django-nonrel安装任何其他软件包(除了 mongodb-engine-master)