Skip to main content

Automatically discover and register Flask blueprints

Project description

Flask-Blueprints-Loader is an extension for Flask that automatically discovers and registers Blueprint for your application.

Installing

Install using pip:

$ pip install -U flask-blueprints-loader

Initialize the Extension

Application Instance Pattern

from flask import Flask
from flask_blueprints_loader import BlueprintsLoader

app = Flask(__name__)
loader = BlueprintsLoader(app)

with app.app_context():
   loader.register_blueprints()

Application Factories Pattern

from flask import Flask
from flask_blueprints_loader import BlueprintsLoader

loader = BlueprintsLoader()

def create_app():
   app = Flask(__name__)
   loader.init_app(app)

   with app.app_context():
      loader.register_blueprints()

   return app

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_blueprints_loader-0.1.0.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

flask_blueprints_loader-0.1.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page