How to load from more then one template_folder for Flask blueprint? How to load from more then one template_folder for Flask blueprint? flask flask

How to load from more then one template_folder for Flask blueprint?


Here is the trail of investigations.

From flask.blueprints

class Blueprint(_PackageBoundObject):    ....    def __init__(self, name, import_name, static_folder=None,                 static_url_path=None, template_folder=None,                 ...)        _PackageBoundObject.__init__(self, import_name, template_folder)    ....

From flask.helpers

@locked_cached_propertydef jinja_loader(self):    """The Jinja loader for this package bound object.    .. versionadded:: 0.5    """    if self.template_folder is not None:        return FileSystemLoader(os.path.join(self.root_path,                                             self.template_folder))

Investigation Result:

  1. template_folder which is passed to Blueprints is subsequently to class _PackageBoundObject
  2. It is treated as a single string and not as a list of folders

Result:

  1. You can not pass multiple paths for template_folder