python - What is the point of initializing extensions with the flask instance in Flask? -
following miguel grinberg's book flask web development, have initialize alot of exetensions flask instance point of doing this?
examples
app = flask(__name__) manager = manager(app) bootstrap = bootstrap(app) moment = moment(app)
you can @ source of each of extensions see they're doing.
in general, setting configuration, setting callbacks before , after request events, , using information app initialize.
if don't pass app (or later call init_app
), extension can't finish initializing , unusable.
Comments
Post a Comment