11

特定のへの最初のリクエストの前に関数を実行することは可能blueprintですか?

@my_blueprint.before_first_request
def init_my_blueprint():
    print 'yes'

現在、これにより次のエラーが発生します。

AttributeError: 'Blueprint' object has no attribute 'before_first_request'
4

1 に答える 1