1.

Explain How You Request Database Connections In Flask?

Answer»

Flask allows to request database in THREE ways:

  1. before_request() : They are CALLED before a request and pass no arguments
  2. after_request() : They are called after a request and pass the response that will be sent to the CLIENT
  3. teardown_request(): They are called in situation when exception is raised, and response are not guaranteed. They are called after the response been constructed. They are not allowed to modify the request, and their values are IGNORED.

Flask allows to request database in three ways:



Discussion

No Comment Found