aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/init/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/init/__init__.py')
-rw-r--r--mediagoblin/init/__init__.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py
index c129cbf8..b8ed2456 100644
--- a/mediagoblin/init/__init__.py
+++ b/mediagoblin/init/__init__.py
@@ -13,3 +13,21 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import jinja2
+
+
+def get_jinja_loader(user_template_path=None):
+ """
+ Set up the Jinja template loaders, possibly allowing for user
+ overridden templates.
+
+ (In the future we may have another system for providing theming;
+ for now this is good enough.)
+ """
+ if user_template_path:
+ return jinja2.ChoiceLoader(
+ [jinja2.FileSystemLoader(user_template_path),
+ jinja2.PackageLoader('mediagoblin', 'templates')])
+ else:
+ return jinja2.PackageLoader('mediagoblin', 'templates')