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

connect mongodb with djongo (Django)

i try connect to mongodb with djongo after reading githup page of djongo and this find same question here but no answer as well change setting.py like this DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'namename', …
Nozar Safari
  • 505
  • 4
  • 17
0
votes
1 answer

POST and PATCH operations in ArrayModelField using Django DRF

I am using Django 2.2, MongoDb with Djongo. I am facing issues in POST and PATCH API. I am facing three kinds of issues. When performing a POST operation to create a new entry, API fails with error: Array items must be Model instances. What is the…
antman
  • 317
  • 6
  • 16
0
votes
1 answer

Serialize ArrayModelField into JSON in Django DRF

I am using Djongo with Django 2.2. I am using MongoDb and using Djongo. i am facing issues in GET API. The Comment model is not serialized. Following is the code snippet. models.py import uuid from djongo import models class Comment(models.Model): …
antman
  • 317
  • 6
  • 16
0
votes
1 answer

Django + Legacy MongoDB

I have to use Django with a legacy MongoDB database. I have made the connection but I don't know how to access the documents/data present inside the database? For relational legacy databases, we use inspectdb command and we get references for the…
0
votes
0 answers

Error while updating mongodatabase collections from django app using djongo

I am facing an error. I am trying out the polls tutorial as provided in the django documentation. The problem is with the django 'F' function. I am trying to update the number of votes for a choice. If I load the choice object into python memory and…
Debdipta Halder
  • 497
  • 1
  • 5
  • 19
0
votes
1 answer

django.db.utils.ProgrammingError: column calculator_calculation._id does not exist using heroku and djongo

My app works on my local machine but when deployed to heroku with the exact same code I get errors when using get requests to my API views involving any DB interaction. I have a feeling heroku is trying to use postgres for some reason, even though I…
0
votes
1 answer

where can i find the location of the path of URL in getJSON

I’m trying to find the location of the URL parameter /info/getips/ in GetJSON function. Below is my code. I am using ubuntu. this is a Djongo project : File :Board.js dashboard.getIps = function() { $.getJSON('/info/getips/', function(data) { …
user12139116
0
votes
0 answers

Django, Can not migrate when change the default database engine to djongo

I'm new in django and facing a problem that I can not migrate changes in when I change the default sqlite3 engine to "djongo". I'm using ubuntu server, and I have done the following steps: $ pip3 install djongo # setup djongo DATABASES = { …
Karam Haj
  • 1,080
  • 2
  • 9
  • 20
0
votes
1 answer

Creating ModelForm with EmbeddedModelField and customize fields within EmbeddedModelField

I have a model (parentmodel) which is having a EmbeddedModelField (embedmodel). This is basically a document in MongoDB. Below is the Model classes class embedmodel(models.Model): sendto = models.CharField(max_length=10) sendtouser =…
Somesh Garje
  • 105
  • 11
0
votes
1 answer

Varying embedded document

I am currently trying to connect my new Django rest API to my already existing mongodb database. Currently I am trying to copy the structure of my database objects as models. I ran into the problem, that I set up a structure like this in my db: { …
Alex Haller
  • 295
  • 2
  • 17
0
votes
1 answer

Why do I get a userId duplicate key error even though my model does not have user as the primary key?

I have an Interactions model which inherits from the predefine django user model, but I have the messageId to be the primary key. models.py: class Interaction(models.Model): messageId = models.TextField(max_length=5000,primary_key=True, unique =…
Vruksha Nikam
  • 45
  • 1
  • 2
  • 6
0
votes
2 answers

Django unable to load model into views

I am trying to import my models into views.py but I am unable to do so. However I am able to register them on the admin site but when I use the same code I used in admin.py to import the models into views.py, I get an error. I am using djongo so I…
Rajan
  • 73
  • 1
  • 8
0
votes
2 answers

How do I fix these errors?

I have an sqlite3 databased django app. I was trying to use djongo to switch to MongoDB Atlas. But I don't know how to fix these errors I installed djongo DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'test', …
Vruksha Nikam
  • 45
  • 1
  • 2
  • 6
0
votes
0 answers

Is it possible to embed an ArrayModelField inside ArrayModelField?

I'm working on a project using django connecting to a MongoDB database using djongo. I have a few models and a few abstract models that I embed as ArrayModelFields. However when I try to use an ArrayModelField inside a model that is in-turn…
Tisagh
  • 11
  • 3
0
votes
2 answers

How to fix "isinstance() arg 2 must be a type or tuple of types" error in Django

I created a Django (v. 2.1.5) model called Metric that has itself as an embed model, as you can see below: from djongo import models class Metric(models.Model): _id = models.ObjectIdField() ... dependencies = models.ArrayModelField( …