Skip to content

Instantly share code, notes, and snippets.

@davidwtbuxton
Created May 31, 2012 16:39
Show Gist options
  • Save davidwtbuxton/2844639 to your computer and use it in GitHub Desktop.
Save davidwtbuxton/2844639 to your computer and use it in GitHub Desktop.
Flask with more than one template folder
import jinja2
import flask
app = flask.Flask(__name__)
custom_loader = jinja2.ChoiceLoader([
# Re-use the default template dir first
app.jinja_loader,
# And add a new shared template dir
jinja2.FileSystemLoader('/path2'),
])
app.jinja_loader = custom_loader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment