def register_blueprints(app, package_name, package_path):
 rv = []
 for (_, name, _) in pkgutil.iter_modules(package_path):
  m = importlib.import_module(('%s.%s' % (package_name, name)))
  for item in dir(m):
   item = getattr(m, item)
   if isinstance(item, Blueprint):
    app.register_blueprint(item)
   rv.append(item)
 return rv

def register_blueprints ( app , package_name , package_path ) : rv = [ ] for ( _ , name , _ ) in pkgutil . iter_modules ( package_path ) : m = importlib . import_module ( ( '%s.%s' % ( package_name , name ) ) ) for item in dir ( m ) : item = getattr ( m , item ) if isinstance ( item , Blueprint ) : app . register_blueprint ( item ) rv . append ( item ) return rv
register all blueprint instances on the specified flask application found in all modules for the specified package .