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
2
votes
0 answers

Django: Get queryset of nested objects in Retrieve API View

I'm creating a Django application with django-rest-framework and using djongo to connect to MongoDB. I have a nested model as such: class Group(models.Model): group_code = models.CharField( max_length=15, blank=False, …
2
votes
3 answers

Using django rest framework, how to add new nested child object for existing parent object

I am trying to build a data storage for time series data, for this I have created nested objects Coin and Data, where Coin is parent object and contains Data entries that each data entry is individual object. at this moment my code creates nested…
2
votes
3 answers

Django always connects to localhost mongodb

I have followed the guide of db connection config: https://nesdis.github.io/djongo/database-configuration/ However, it always connects to localhost one, not my setting's one. Does anyone have any idea on this issue? my packages versions: Django …
Louis Luk
  • 303
  • 2
  • 16
2
votes
0 answers

How to modify Djongo ArrayModelField as shown in Django Admin

I'm experimenting with Djongo right now. So far a great project! What I don't like yet is the way ArrayModelField fields are integrated in the Django admin. I am missing something like an add-button. At the moment only one additional empty inline…
Gurkenkönig
  • 678
  • 15
  • 36
2
votes
1 answer

Django not able to run manage.py

I'm not able to run my Django server in local. I'm trying to setting my djongo database instead of default sqlite3 .db Here I followed the below URL for djongodjongo on python set up System check identified no issues (0 silenced). Unhandled…
SethuNagaKarthik
  • 387
  • 1
  • 3
  • 17
2
votes
1 answer

Using Djongo (Mongo ORM) with CosmosDB?

I am currently trying to use djongo with a CosmosDB database as CosmosDB integrate the MongoDB API. I enabled both 'Aggregation Pipeline' and '3.4 wire protocol' as Djongo require MongoDB 3.4 to work. With this setup, i cannot pass the initial…
Jisson
  • 51
  • 7
2
votes
1 answer

Unusual error in Django. Cannot login into admin after creating superuser

This is a weird problem that I am facing in my Django application. Configuration : Python 3.6 Django 2.0.6 DB : Djongo (MongoDB connector : Djongo repository) I have overwritten the create_superuser to: def create_superuser(self, email,…
pissall
  • 7,109
  • 2
  • 25
  • 45
1
vote
0 answers

Django reflexive relationship

I am working with MongoDB v6.0.6 and Django v4.1.9. I have a reflexive relationship in one of my models: class Learner(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) supervisor = models.ForeignKey('self',…
jDimmy
  • 21
  • 3
1
vote
0 answers

can we create arrayfield without creating model container?

I am facing problem in creating array field in mongo using django... I am using djongo connector... can't we create ArrayField in without specifying the model container ... I don't want to specify model_container in ArrayField because I don't want…
1
vote
0 answers

pymongo.errors.OperationFailure: namespace name generated from index name is too long

I know the index name is too long, django_content_type_app_label_model_76bd3d3b_uniq, but this is auto genarate by django makemigrations, so how to edit and contral this long index name? TKS! pymongo.errors.OperationFailure: namespace name generated…
叶同学
  • 801
  • 1
  • 9
  • 21
1
vote
3 answers

djongo query_set with filter on boolean field

I have a django application with djongo as a database driver. My model is simple: from django.db import models from djongo.models import ObjectIdField class TmpModel(models.Model): _id = ObjectIdField() is_deleted =…
StuffHappens
  • 6,457
  • 13
  • 70
  • 95
1
vote
2 answers

djongo RunPython in database migration

There's a django app with djongo as database driver. I want to add custom migration using RunPython. But I can't understand how to reach pymongo client. Here's the code: from django.db import migrations def _custom_migration(apps, schema_editor): …
StuffHappens
  • 6,457
  • 13
  • 70
  • 95
1
vote
0 answers

Django.db.utils.DatabaseError with MongoDB as Backend Database

Internal Server Error: /loginapi/registeruser/ Traceback (most recent call last): File "C:\Users\HP\AppData\Local\Programs\Python\Python39\lib\site-packages\djongo\sql2mongo\query.py", line 857, in parse return handler(self, statement) File…
1
vote
1 answer

Can't open User model using mongo db

I'm using mongo db in my django project. Whenever I try to open a record of User model in django admin, it gives me this error All the other models are working fine. But getting problem in User model and my user model is
id0bi
  • 68
  • 6
1
vote
0 answers

Value: "" must be an instance of -> in django admin panel(using djongo to connect mongo database)

I am using Django and connecting with a mongodb database using djongo. My database requirements are such that I need to use an embedded field in one of the collections. On adding any entry on Django Admin I am getting a preview error - I have 2…