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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -