Skip to content

Instantly share code, notes, and snippets.

@doobeh
Created September 5, 2018 20:37
Show Gist options
  • Save doobeh/f09a01d56619009ef3e2fb92427c46e7 to your computer and use it in GitHub Desktop.
Save doobeh/f09a01d56619009ef3e2fb92427c46e7 to your computer and use it in GitHub Desktop.
register_blueprints
def register_blueprints(app):
"""Register all blueprint modules
Reference: Armin Ronacher, "Flask for Fun and for Profit" PyBay 2016.
"""
for name in find_modules("gtcloud.blueprints"):
mod = import_string(name)
if hasattr(mod, "bp"):
app.register_blueprint(mod.bp)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment