[Python] Flask deprecated before_first_request how to update

Discussão em 'Python' iniciado por Stack, Julho 4, 2025.

  1. Stack

    Stack Membro Participativo

    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?

    Continue reading...

Compartilhe esta Página