Using Flask-SQLAlchemy in Blueprint models without reference to the app [closed]
I'm trying to create a "modular application" in Flask using Blueprints. When creating models, however, I'm running into the problem of having to reference the app in order to get the db -object provided by Flask-SQLAlchemy. I'd like to be able to use some blueprints with more than one app (similar to how Django apps can be used), so this is not a good solution.* It's possible to do a switcharoo, and have the Blueprint create the db instance, which the app then imports together with the rest of the blueprint. But then, any other blueprint wishing to create models need to import from that