Cannot connect to database default : False is not a read preference.
I use connect(host='mongodb://username:password@localhost:port/database') in my django settings.py.
Run server then got a report:
mongoengine.connection.ConnectionError: Cannot connect to database default :
False is not a read preference.
Is this a bug or not?
Write in python 3.4.3 with django 1.8 and mongoengine 0.9.0
Same problem is described on SO. It looks like mongoengine has some issues with the newest version 3.0 of pymongo released just two days ago. Easiest workaround - revert from version 3.0 to 2.8.
@mseimys Thanks
No problem. Anyway, I wouldn't close this issue just yet - problem is still there, i haven't got enough skills yet to fix it :)
With the progress of refer to: #935 I find it.
Got the same problem, i guess Closed is not meant to, as the issue is still present.
Got the same problem +1
+1
+1
It is fixed in master, so just use mongoengine master (and wait for next release) or use pymongo==2.8. Adding +1 will not help here :)
I already got it working with 2.8 :P so its not just the matter of +1 ;) @MRigal
+1, please how can I downgrade?
@lukaspetr Add pymongo==2.8.1 in your requirements.txt
@hamzawaqas-10p thank you. It was also necessary to change the setting to install_requires=['pymongo==2.8.1'], in mongoengine's setup.py
Will this problem be fixed in the next version?
Since it is in master, for sure :-)
2015-06-04 13:49 GMT+02:00 Petr Lukas [email protected]:
Will this problem be fixed in the next version?
— Reply to this email directly or view it on GitHub https://github.com/MongoEngine/mongoengine/issues/950#issuecomment-108857109 .
@MRigal thank you for the piece of information!
Looks like @MRigal fixed it, thank you!
+1
+1
2.8 it workd!