Concept Flow - Before_request hooks
Client sends HTTP request
Flask receives request
Run before_request hooks
Hook 1
If hook returns response?
Yes→Send that response back
No
Run view function
Send view response back
When Flask gets a request, it runs all before_request hooks first. If any hook returns a response, Flask sends it immediately. Otherwise, it runs the main view function.