[Python] Python Flask Blueprint with classes

Discussão em 'Python' iniciado por Stack, Maio 5, 2025.

  1. Stack

    Stack Membro Participativo

    I am looking at moving to blueprints in Flask, but the current implementation passes the flask app instance into a class as part of the init(), how do I do this with blueprints please?

    def __init__(self, flask_instance, logger, event_manager):
    self._logger = logger
    self._flask = flask_instance
    self._event_manager = event_manager

    # Add route : /management/add
    self._quart.add_url_rule('/job/new_job',
    methods = ['POST'], view_func = self._new_job)

    Continue reading...

Compartilhe esta Página