Thanks, I'm new to Django and Mongo. I had to do additional configuration to create a database user, but it was easy ! Now I'll check how to do some basic quries.
Can u plz tell me which version of djongo you are using ?? I am getting some warnings for the lastest version of djongo. Following are the warnings I am getting: This version of djongo does not support "COLUMN DROP NOT NULL " fully. This version of djongo does not support "DROP CASCADE" fully. This version of djongo does not support "schema validation using KEY" fully. This version of djongo does not support "schema validation using REFERENCES" fully.
I have integrated Django with Mongo db using djongo connector. Now If i create a user named "john" from superuser login and add some tasks to john(which is related to our project) . I log out from superuser and login login as user john, then the tasks assigned from super user login will not be visible here and says could not fetch tasks, and in VS code ,it throws backend error as Sub SQL: None FAILED SQL: SELECT COUNT(*) FROM (SELECT DISTINCT....) Params: (6, 6, 6, 6, 6, 6) Version: 1.3.4 Any idea please.
Hi @prettyprinted .I am using mongodb atlas with free cluster, so before connecting to the mongo atlas db, i connected to local mongo db and ran migrations which was sucessfull.I coould see all the collections created by djongo, but when i treid to connect to atlas using the connection string provided and ran migrations i got "No migrations to apply" and i could not see any collections at all. Can you tell me where am i doing mistake. Thanks .
@@niharikas2073 yeah so far I've solved that issue om that day and it's almost 2 months. I really can't remember the issue anymore. Also forgot to write down the solution. I'm sorry about it. That was for someone else so don't have the project either right now.
Djongo defines itself as The only connector that let's you use Django with MongoDB without changing the Django ORM So i think that Django ORM should work with djongo
Hey thanks for the tutorial, one question though --> Does "djongo" let me use SQL queries by that I mean the queryset we write in django to fetch data even when MongoDB is a NoSQL DB
help pymongo.errors.ServerSelectionTimeoutError: connection closed,connection closed,connection closed. I'm deploying to heroku. I put my Mongo_URI in the environment variable but I can't connect to the bank. need HELP
I'm not exactly sure what you mean, but of course you can combine what you request the database to do with user input.
5 років тому
Hey, have you thought of doing a video on making GraphQL APIs with graphene-python? Seems like many APIs are using GraphQL now instead of REST so I think it would be cool to see how to create GraphQL APIs with python :)
Try using a lower version of pymongo, ==3.5.1and choose Python 3.4 in Atlas for a non-srv string, then edit settings for HOST to be 'mongodb://:@cluster0-shard-00-00-bs91f.mongodb.net:27017,cluster0-shard-00-01-bs91f.mongodb.net:27017,cluster0-shard-00-02-bs91f.mongodb.net:27017/test?ssl=true&ssl_cert_reqs=CERT_NONE&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true&w=majority'
if anyone here is experiencing problems migrating with the certification error. do pip install certifi pip install dnspython goto network access -> add ip address -> dont put anything in -> confirm goto your cluster-> click connect->connect your application -> go to python-> copy paste uri do the whole username and password however here's the important . step copy paste this after test? ssl=true&ssl_cert_reqs=CERT_NONE&retryWrites=false&w=majority mongodb+srv://{username}:{password}@{whatever your cluster is called in uri}/test?ssl=true&ssl_cert_reqs=CERT_NONE&retryWrites=false&w=majority should work gl
Can anyone help with this error? pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 61] Connection refused when trying to run either: or Any Ideas??? EDIT: found the SOLUTION: stackoverflow.com/questions/60871873/djongo-not-connecting-to-mlab-server Also if anyone is stuck on the 'djongo isn't available database': this worked for me: --use PyMongo 3.7.2 #pip uninstall pymongo #pip install pymongo==3.7.2
On Mac I have a SSL certificate problem. This helps: stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate
Hi! I liked you video very much but I am getting connection error all the time. I have MongoDB Atlas (of course, sandbox, free version Cluster) and I got the link to connect to it: mongodb+srv://username:@cluster-b1gml.mongodb.net/test?retryWrites=true&w=majority but the thing is when I run python3 manage.py migrate. It doesn't work at all!! In here the db name is test right? DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'test', 'HOST' : 'mongodb+srv://:@cluster-b1gml.mongodb.net/test?retryWrites=true&w=majority', 'USER' : ', 'PASSWORD' : '' , } } Please note that and are not revealed, in my PC they are. What am I doing wrong? Thanks.
I don't know the exact error but try try using pymongo==3.5.1instead of a higher version. If it claims uri+srv as invalid uri, try installing dnspython if that doesnt work change the connection string settings to a lower version of python, 3.4 should give a non-srv string. If it is not able to verify the certificate use this as the host instead : 'mongodb://:@cluster0-shard-00-00-bs91f.mongodb.net:27017,cluster0-shard-00-01-bs91f.mongodb.net:27017,cluster0-shard-00-02-bs91f.mongodb.net:27017/test?ssl=true&ssl_cert_reqs=CERT_NONE&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true&w=majority'
Join my free course on working with the database and models in Django: prettyprinted.com/djangodata
Firebase with django, can you please make a video on it?
Bro tnks alot I was waiting for this tutorial since I started ur course Django 2.1
Glad you liked the video.
Thanks, I'm new to Django and Mongo. I had to do additional configuration to create a database user, but it was easy ! Now I'll check how to do some basic quries.
I'm glad the video helped. Thanks for watching.
is it easy to use mongodb as a databse in django or its different from all the rest of the databases like sqllite and postgre provided by django
that's something good but is it right thing to do in production??
Can u plz tell me which version of djongo you are using ?? I am getting some warnings for the lastest version of djongo.
Following are the warnings I am getting:
This version of djongo does not support "COLUMN DROP NOT NULL " fully.
This version of djongo does not support "DROP CASCADE" fully.
This version of djongo does not support "schema validation using KEY" fully.
This version of djongo does not support "schema validation using REFERENCES" fully.
my database CosmoDB is host on Azure and I need to connect it to the djongo but can`t. so please help me
I have integrated Django with Mongo db using djongo connector. Now If i create a user named "john" from superuser login and add some tasks to john(which is related to our project) .
I log out from superuser and login login as user john, then the tasks assigned from super user login will not be visible here and says could not fetch tasks, and in VS code ,it throws backend error as Sub SQL: None
FAILED SQL: SELECT COUNT(*) FROM (SELECT DISTINCT....)
Params: (6, 6, 6, 6, 6, 6)
Version: 1.3.4
Any idea please.
Hi @prettyprinted .I am using mongodb atlas with free cluster, so before connecting to the mongo atlas db, i connected to local mongo db and ran migrations which was sucessfull.I coould see all the collections created by djongo, but when i treid to connect to atlas using the connection string provided and ran migrations i got "No migrations to apply" and i could not see any collections at all.
Can you tell me where am i doing mistake.
Thanks .
did it get resolved?? how>
django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available database backend.
what to do about this?
Did you got solution to this error? Because I also got same
@@niharikas2073 yeah so far I've solved that issue om that day and it's almost 2 months. I really can't remember the issue anymore. Also forgot to write down the solution. I'm sorry about it. That was for someone else so don't have the project either right now.
@@OurCodeSchool Ok.. No problem
always look for dependencies first,,
>>>>djongo does not support django3*
@@anantkumar235 I'm using django 2.2
Awesome video! I have one question... Can i use Django ORM (QuerySets) with Djongo? Thanks!
Djongo defines itself as The only connector that let's you use Django with MongoDB without changing the Django ORM
So i think that Django ORM should work with djongo
django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available database backend.
Any ideas?
django version?
@@pushkargarg7140 Yeah that was the issue, doesn't work for Django 3.0.
@@Childishforlife yes I'm facing the same issue with Django 3 so I rolled back to Django 2.2
Hi can you create a new tutorial using djongo and creating and migrating models
Hey thanks for the tutorial, one question though --> Does "djongo" let me use SQL queries by that I mean the queryset we write in django to fetch data even when MongoDB is a NoSQL DB
hey bro did you got its answer??
I have to use drf to make api with mongodb does it works the same?
@@iambhushan418 django comes with python orm for SQL ie sql-alchemy similarly their is pymongo for document DB like mongoDB.
@@chinmaydali3083 yeah
help pymongo.errors.ServerSelectionTimeoutError: connection closed,connection closed,connection closed.
I'm deploying to heroku. I put my Mongo_URI in the environment variable but I can't connect to the bank.
need HELP
You need to register your system Ip address to solve this error
Thank you so much;
Can you please do a video on how to dynamically create subdomains in django. Really appreciate.
I'll look into it. Thanks for the idea.
I have a mongo db on a docker container, i want to connect my django app to that but idk how, someone can help me?
can i connect djongo with a db in mongo wit data preexisting???
Hi how u do a request for put with ObjectId as pk?
Nice sir.....pls make some videos about mangoDB
I'll look into MangoDB. Thanks.
how to use pre-existing mongo collection with djongo?
Maybe this will help: github.com/nesdis/djongo/issues/38
sir please create a website by using mongodb and django together with some crud some operations and of possible an ecommerce one please sir.
ty man u helped me a lot
You're welcome. Thanks for watching.
Can we have Mongo dynamic aggregations in basis of user input ?
I'm not exactly sure what you mean, but of course you can combine what you request the database to do with user input.
Hey, have you thought of doing a video on making GraphQL APIs with graphene-python? Seems like many APIs are using GraphQL now instead of REST so I think it would be cool to see how to create GraphQL APIs with python :)
I've been meaning to do that actually. I'll start planning out of a GraphQL video. Thanks for reminding me.
Can you please do a video on how to connect aws dynamodb in djnago ?.Really appreciate.
I'll consider that idea. Thanks.
Thanks Guy!
Thanks for watching!
great
ERROR - " pymongo.errors.OperationFailure: unsupported type in filter " ......please Help
i m getting the same error
Try using a lower version of pymongo, ==3.5.1and choose Python 3.4 in Atlas for a non-srv string, then edit settings for HOST to be
'mongodb://:@cluster0-shard-00-00-bs91f.mongodb.net:27017,cluster0-shard-00-01-bs91f.mongodb.net:27017,cluster0-shard-00-02-bs91f.mongodb.net:27017/test?ssl=true&ssl_cert_reqs=CERT_NONE&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true&w=majority'
help pymongo.errors.ServerSelectionTimeoutError: connection closed,connection closed,connection closed
Where do you have your MongoDB?
@@prettyprinted python Django , limited English 😥
I’m getting a certificate error :/
if anyone here is experiencing problems migrating with the certification error.
do
pip install certifi
pip install dnspython
goto network access -> add ip address -> dont put anything in -> confirm
goto your cluster-> click connect->connect your application -> go to python-> copy paste uri
do the whole username and password
however here's the important . step
copy paste this after test?
ssl=true&ssl_cert_reqs=CERT_NONE&retryWrites=false&w=majority
mongodb+srv://{username}:{password}@{whatever your cluster is called in uri}/test?ssl=true&ssl_cert_reqs=CERT_NONE&retryWrites=false&w=majority
should work gl
This does not work for Django 3.0
Can anyone help with this error?
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 61] Connection refused
when trying to run either: or Any Ideas???
EDIT: found the SOLUTION: stackoverflow.com/questions/60871873/djongo-not-connecting-to-mlab-server
Also if anyone is stuck on the 'djongo isn't available database': this worked for me:
--use PyMongo 3.7.2
#pip uninstall pymongo
#pip install pymongo==3.7.2
Thank you for this!
Would you use MongoDB for production if not, why use MongoDB?
I don't like it has a database, but other people do, so I cover it here to help them.
@@prettyprinted Sorry, I don't understand. Do you mean you are not gonna use MongoDB for production? If not may I ask why?
@@anonymousrulz I just prefer relational databases. I have more experience with them, and I don't think Mongo offers any advantages for me.
On Mac I have a SSL certificate problem. This helps: stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate
Hi!
I liked you video very much but I am getting connection error all the time. I have MongoDB Atlas (of course, sandbox, free version Cluster) and I got the link to connect to it: mongodb+srv://username:@cluster-b1gml.mongodb.net/test?retryWrites=true&w=majority
but the thing is when I run python3 manage.py migrate. It doesn't work at all!! In here the db name is test right?
DATABASES = {
'default': {
'ENGINE': 'djongo',
'NAME': 'test',
'HOST' : 'mongodb+srv://:@cluster-b1gml.mongodb.net/test?retryWrites=true&w=majority',
'USER' : ',
'PASSWORD' : ''
,
}
}
Please note that and are not revealed, in my PC they are. What am I doing wrong?
Thanks.
What error do you get?
I don't know the exact error but try try using pymongo==3.5.1instead of a higher version. If it claims uri+srv as invalid uri, try installing dnspython if that doesnt work change the connection string settings to a lower version of python, 3.4 should give a non-srv string. If it is not able to verify the certificate use this as the host instead
: 'mongodb://:@cluster0-shard-00-00-bs91f.mongodb.net:27017,cluster0-shard-00-01-bs91f.mongodb.net:27017,cluster0-shard-00-02-bs91f.mongodb.net:27017/test?ssl=true&ssl_cert_reqs=CERT_NONE&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true&w=majority'