mongodb - create mongo connection handler with python -
How to write mongo connection handlers with pongo? I want to ask for a connection to all the modules in my program. I mean use pymongo MongoClient for example and write handler for it. For example in your application anywhere, such as a __ init __.py and then import that object wherever you want it to be used. Customer enforces connection pooling, so you should be correct without writing any additional handlers. Example: ap / __init__.py db = Mongo client () and then App / ModuleApplication DB