Questions tagged [djongo]

For usage with the djongo backend driver for MongoDB with the Django framework

Djongo allows you to use MongoDB as the database back end with the Django framework.

The project can be found on GitHub:

https://github.com/nesdis/djongo

274 questions
22
votes
9 answers

Why I am getting "Not Implemented Error: Database objects do not implement truth value testing or bool()." while running makemigration cmd in django

I am trying to connect Django with MongoDB using Djongo. I have changed the Database parameter but I am getting this error Not Implemented Error: Database objects do not implement truth value testing or bool(). when I am running makemigration…
Aman Jain
  • 223
  • 1
  • 2
  • 6
8
votes
2 answers

Django: Abstract models cannot be instantiated for models for retrieving data

I am working on a project which has one abstract model and one main model for Djongo. When I try to insert a value, it is getting inserted without errors. But when I try to retrieve the data I get " Abstract models cannot be instantiated". Here is…
7
votes
4 answers

Django EmbeddedField raises ValidationError because of renamed field

I've got a Django application with djongo as a database driver. The models are: class Blog(models.Model): _id = models.ObjectIdField() name = models.CharField(max_length=100, db_column="Name") tagline = models.TextField() class…
StuffHappens
  • 6,457
  • 13
  • 70
  • 95
7
votes
1 answer

Djongo + Django + MongoDB Atlas DatabaseError when trying to reset password

So I'm trying to create a password reset link for a website that is running on Django and uses Djongo. Whenever I enter a password and click on the reset password button, this error occurs: Environment: Request Method: POST Request URL:…
7
votes
7 answers

How to connect Django ORM to mongo atlas?

I am trying to connect my django instance to a mongo db cluster using django. I have checked from various sources and the way it is getting closer to work is: Install dnspython Have the following DATABASES dict in settings.py DATABASES = { …
py_script
  • 808
  • 2
  • 16
  • 38
6
votes
2 answers

Not saving the record into mongodb DB in Django, Actually I am trying explore multiple different DB (Postgresql, Mongodb) in a single app

I am trying to use multiple different DB in a single app(todo). I am using Djongo package for dealing mongodb. Settings.py DATABASES = { 'default':{}, 'sql_db': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME':…
6
votes
3 answers

Django EmbeddedModelField saying "This field may not be blank" when doing PUT request despite field having "blank=True"

I'm creating a Django application with django-rest-framework and using djongo to connect to MongoDB. I have nested models as such: class Group(models.Model): users = models.ArrayModelField( model_container=User ) class…
sexyspecs
  • 125
  • 1
  • 2
  • 6
4
votes
1 answer

Django Foreignkey in MongoDB's EmbeddedField

I am using Djongo engine for MongoDB in my Django project. I have two tables # app/models.py # My Main Table class Questions(models.Model): questionId = models.UUIDField(default=uuid.uuid4, editable=True, unique=True) question =…
danish2694
  • 199
  • 3
  • 16
4
votes
1 answer

Use mongoDB with django 3.0

As I said in the title I want to integrate mongoDB next to my Postgres Database in a Django3.0 project. I used to use djongo* but it seems it's not compatible with the latest version of Django. What do you think is the best connector to use…
Kimor
  • 532
  • 4
  • 17
3
votes
1 answer

Django Admin Foreign Key Error on Djongo database engine

I'm using djongo package for a database backend engine in order to connect to MongoDB and define my models on it. settings.py: DATABASES = { # 'default': { # 'ENGINE': 'django.db.backends.sqlite3', # 'NAME': str(BASE_DIR / 'db.sqlite3'), …
ahmad
  • 31
  • 4
3
votes
1 answer

Djongo mapper issue with mongo_aggregate()

Facing issue with mongo_aggregate(). Below is the stacktrace. Traceback (most recent call last): File "/Users/Pritam/Documents/DjangoWorkspace/tracking-admin/backend/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in…
Pritam Kadam
  • 3,203
  • 4
  • 19
  • 41
3
votes
0 answers

Docker-compose with Django, MongoDB using Djongo ERROR - pymongo.errors.ServerSelectionTimeoutError

I want to get a django app running using djongo with mongo, and docker. My setup looks like this: docker-compose.yml version: '3.7' services: webserver: build: context: . ports: - "8000:8000" …
한승욱
  • 51
  • 1
  • 6
3
votes
1 answer

Django MongoDB Migration Warnings

Applying contenttypes.0001_initial...This version of djongo does not support "schema validation using CONSTRAINT" fully. Visit https://www.patreon.com/nesdis OK Applying auth.0001_initial...This version of djongo does not support "schema…
Soumya
  • 31
  • 1
  • 4
3
votes
1 answer

How to have list of strings in Django REST framework model using MongoDB

I am using Django version 2.2.11 with MongoDB as database I a Simple Array Field to store a list of strings in a Django REST framework Model. I want the serialized JSON output to be like this. { name : "John" roles : [ "string1", "string2"…
3
votes
1 answer

Django & MongoDB has issue with default ID autoField on django models

I have Django 2 that the Rest Framework and Djongo is used in it. The Account can be created but when I try to see the list of created Accounts to updated or do any operation on them I can't actually I can't retrieve the list of Accounts and gives…
Nasser Ali Karimi
  • 4,462
  • 6
  • 34
  • 77
1
2 3
18 19