I am new to PyMongo and Flask, but I have finished the flask tutorial and feel pretty comfortable with it. Now I am trying to implement a flash server with MongoDb, and I am not sure how to proceed.
I see that there are two libraries PyMongo and Flask-PyMongo. It is not clear to me what I should use, or I need to use both. How do they interact and such ...
Firstly, I try to connect to mongodb, it works for me in the background, and I see connections when I start my flask server, so it should work. PyMongo offers methods for connecting to a specific database using db = client['test-database'] . It seems that Flask-pymongo just gives a db connection from nowhere when using mongo = PyMongo(app) , then mongo.db to access the db.
Being a newcomer to mongo, this all confuses me, I was hoping that someone could give me a clear answer to all my questions, searches on the Internet do not show many results in the library of flux pimongo.
I looked at this question: What is the relationship between a flask, a mongokit, a pimongo, a flask pimongo? but she understood nothing for me.
source share