Explain me database connection in python flask?
Answer / Khushboo A Risalat
The Python Flask framework does not have built-in database connectivity. Instead, you can use various extensions like Flask-SQLAlchemy or Flask-MongoEngine to handle database connections. To set up a SQLAlchemy database connection, install the extension, import it in your app, create an instance of the SQLAlchemy class, and define the engine, username, password, host, and database name within that instance. Then, you can use this instance whenever you need to interact with the database.
| Is This Answer Correct ? | 0 Yes | 0 No |
How can you make a python script executable on unix?
How would you implement inheritance in python?
How can you keep track of different versions of code?
Difference between pass and continue in python?
What does the 'yield' keyword do in python?
Explain me what is the statement that can be used in python if the program requires no action but requires it syntactically?
What is a lambda in math?
Explain garbage collection in python?
What is a lambda in programming?
How to share global variables across modules?
Explain finally keyword?
Which version of python is best?