I'm learning web development for simple applications and I've created one that uses before_first_request
decorator. According with the new release notes, the before_first_request is deprecated and will be removed from Flask 2.3:
Deprecated since version 2.2: Will be removed in Flask 2.3. Run setup code when creating the application instead.
I don't understand how I can update my code to be complacent with Flask 2.3 and still run a function at first request without using before_first_request. Could some kind soul give me an example?
before_first_request
into the init code of the Flask app. See this excellent guide on how to set up a Flask app using AFP – Coumarone