In Flask, to register a function to run before each request, you would use the ____ decorator.

  • @before_render
  • @before_request
  • @pre_request
  • @request_handler
In Flask, the @before_request decorator is used to register a function that runs before each request to the application. This is often used for tasks like setting up database connections or authentication checks.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *