Last active
September 9, 2015 14:17
-
-
Save mrjoes/d1d9586c3d789aa0f9e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path as op | |
from flask import Flask | |
from flask.helpers import locked_cached_property | |
from jinja2 import FileSystemLoader | |
class BubbleApp(Flask): | |
def __init__(self): | |
super(BubbleApp, self).__init__(__name__) | |
# Custom template loader with support for plugins | |
@locked_cached_property | |
def jinja_loader(self): | |
paths = [] | |
plugin_path = op.join(op.dirname(op.abspath(__file__)), 'customizations', 'templates') | |
if op.exists(plugin_path): | |
paths.append(plugin_path) | |
paths.append(op.join(self.root_path, self.template_folder)) | |
return FileSystemLoader(paths) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment