[Django]-Mongoengine.connection.ConnectionError: Cannot connect to database default : [Errno 111] Connection refused

2๐Ÿ‘

โœ…

So I figured out my own issue. Iโ€™m new to mongo so I thought that it would work the same way as sqlalchemy where a sqlite DB would be automatically created in the pythonanywhere platform, which is not the case.

For everyone using pythonanywhere together with mongo for their first time, make sure you get an external service (I am using MongoLab on Amazon AWS). Once you have set up a database, you can connect to it by providing the right MongoDB URI in the mongoengine.connect function.

๐Ÿ‘คno8do

1๐Ÿ‘

Pymongo 3.0 and above versions have this problem.you should first uninstall latest version and then install python-pymongo==2.8.1

๐Ÿ‘คUdit Kumawat

0๐Ÿ‘

Make sure that mongodb is up and running.

service mongod status
service mongod start (on ubuntu)
๐Ÿ‘คSaeed Farzian

Leave a comment