Explain me database connection in python flask?



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

Post New Answer

More Python Interview Questions

How can you make a python script executable on unix?

1 Answers  


How would you implement inheritance in python?

1 Answers  


How can you keep track of different versions of code?

1 Answers  


Difference between pass and continue in python?

1 Answers  


What does the 'yield' keyword do in python?

1 Answers  


Explain me what is the statement that can be used in python if the program requires no action but requires it syntactically?

1 Answers  


What is a lambda in math?

1 Answers  


Explain garbage collection in python?

1 Answers  


What is a lambda in programming?

1 Answers  


How to share global variables across modules?

1 Answers  


Explain finally keyword?

1 Answers  


Which version of python is best?

1 Answers  


Categories