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
1
vote
1 answer

Can't connect MongoDB with Djongo, Connection timeout error occurs

settings.py requirements.py docker-compose.yml error message. raise ServerSelectionTimeoutError( pymongo.errors.ServerSelectionTimeoutError: ac-yyvwtll-shard-00-00.gcdfin1.mongodb.net:27017: connection…
Fasil K
  • 473
  • 4
  • 17
1
vote
1 answer

Django gives error even though database is connected

i dont know why. but it works well on local pc and i putted it on CPanel its connected to database. but when i load a page. it gives dbError: this code works in localhost ( on my pc ) but when i uploaded it on cpanel it gives error ;/ ( db is on…
YasharProTPC
  • 43
  • 1
  • 6
1
vote
2 answers

Problem to connect the django with mongodb using djongo

How i use DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'rede_social', 'HOST': 'mongodb+srv://blackwolf449:3CErLxvGLPM4rLsK@cluster0.w1ucl2e.mongodb.net/?retryWrites=true&w=majority', 'USER':…
1
vote
1 answer

“non_field_errors”: [ “Invalid data. Expected a dictionary, but got QuerySet.” ] problem with serializer or model from djongo

I've recently started to learn django. And at this time i'm working on integrating mongoDB with Django using djongo driver. I've created a model for saving and mapping my data objects to mongoDB but i'm lacking knowledge about implementing…
1
vote
1 answer

DRF + Djongo: How to access and work with ID from legacy database?

I set up a Django REST Framework (DRF) in combination with djongo, since I'm having a legacy database in MongoDB/Mongo express. Everything runs through a docker container, but I don't think that this is the issue. My model looks like this: from…
Viktoria
  • 533
  • 2
  • 7
  • 24
1
vote
1 answer

Djongo migrate models cons

Its's nice to see mongodb is connected with django but doesn't support completely. I explain why so because when you install any third party packages to your project it could written for Django models not Djongo which will fall you in Database error…
1
vote
0 answers

Djongo + Django + MongoDB not support chainning filter

I have two model: Content and Tag that have ManyToMany realationship Content(models.Model): tags = models.ManyToManyField(Tag, null=False, blank=False, …
1
vote
1 answer

the Django's mongodb support library djongo will close the db automatically

I use MongoDB as the Django's database and I use djongo for operation, it seems that it will close the connection automatically and can't restore. For example, I create a simple view to show all the records like before: book_res =…
Selvaria
  • 11
  • 2
1
vote
0 answers

Django QuerySet Regex with MongoDB

I am trying to use Django QuerySet/Filter with Regular Expression to filter the records in my MongoDB database. For the Python packages, I'm using: Django 4.0.3 djongo 1.3.6 pymongo 3.12.6 Here's my current attempt (code): import re from .models…
G.Huan
  • 143
  • 1
  • 7
1
vote
1 answer

Testing Django with MongoDB(Djongo)

I'm looking for a way to test my Django app that works with MongoDB using Djongo. I found Django Test Addons library but as I understood, it only works with mongoengine. Is there any manner to make it work with Djongo or do you know another similar…
dfuente
  • 11
  • 2
1
vote
0 answers

How to store a file in mongo db database using a Django REST framework api?

I want to upload a large file to an API endpoint and store that file into a mongo db database (I am using DRF)
KHAN
  • 57
  • 7
1
vote
0 answers

Django Rest Framework and Djongo: serializer create method returns an object with incorrect _id

I have following Djongo model: from djongo import models class Feedback(models.Model): _id = models.ObjectIdField() title = models.CharField(blank=False, max_length=100) text = models.TextField(blank=False) datetimestmp =…
1
vote
1 answer

having trouble getting desired response from django restframework

I am working on an app based on Flutter (frontend), django (backend), mongodb atlas (database). In my app users can add posts, like, or comment on those posts (just like facebook!) in django my models.py has separate tables for Posts, Reacts on…
1
vote
1 answer

Model instances without primary key value are unhashable with Djongo

I am getting the error Model instances without primary key value are unhashable when trying to remove a model instance from my admin panel. models.py from djongo import models import uuid PROPERTY_CLASSES = ( ("p1", "Video Property"), …
Quick33
  • 37
  • 1
  • 5
1
vote
1 answer

django.db.utils.ConnectionDoesNotExist: The connection prueba doesn't exist

I want migrate Django database to MongoDB with Djongo but I have this error. I am trying to connect to a MongoDB Atlas Database. Traceback (most recent call last): File "/home/alexsaca/python3EnvDec/lib/python3.8/site-packages/django/db/utils.py",…
alexsierre
  • 11
  • 3