Problem is in api/views/raw.py. Connection to DB is dead by the time the request is made, resulting in pymongo.errors.ServerSelectionTimeoutError. Solution is to delay connection tot he DB to the time of the request.
Solve using connect=False in pymongo client object, this delays connection to the DB until first request is made to the DB.
Problem is in
api/views/raw.py
. Connection to DB is dead by the time the request is made, resulting inpymongo.errors.ServerSelectionTimeoutError
. Solution is to delay connection tot he DB to the time of the request. Solve usingconnect=False
in pymongo client object, this delays connection to the DB until first request is made to the DB.