Skip to content

Instantly share code, notes, and snippets.

@codeif
codeif / helpers.py
Created November 21, 2016 03:51
Register all Blueprint instances on the specified Flask application.
# -*- coding: utf-8 -*-
import pkgutil
import importlib
from flask import Blueprint
def register_blueprints(app, module_prefix, package_path):
"""Register all Blueprint instances on the specified Flask application found
in all modules for the specified package.