Permalink
Browse files

Added jinja

  • Loading branch information...
1 parent 3b1e058 commit 093cc46e14d9c4bf95d6e760ace9ff47f804e59f @pennyfx pennyfx committed with pennyfx Oct 27, 2011
Showing with 19 additions and 3 deletions.
  1. +1 −0 requirements/compiled.txt
  2. +18 −3 settings.py
@@ -4,3 +4,4 @@
MySQL-python==1.2.3c1
simplejson==2.1.1
lxml==2.3
+Jinja2==2.5.5
View
@@ -215,11 +215,26 @@
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
- 'django.template.loaders.eggs.load_template_source',
+ 'jingo.Loader',
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
)
+JINGO_EXCLUDE_APPS = [
+ 'debug_toolbar'
+]
+
+JINJA_CONFIG = {'autoescape': False}
+
+def JINJA_CONFIG():
+ import jinja2
+ from django.conf import settings
+ config = {'extensions': ['jinja2.ext.do',
+ 'jinja2.ext.with_', 'jinja2.ext.loopcontrols'],
+ 'finalize': lambda x: x if x is not None else ''}
+
+ return config
+
MIDDLEWARE_CLASSES = [
# Munging REMOTE_ADDR must come before ThreadRequest.
'commonware.response.middleware.GraphiteRequestTimingMiddleware',

0 comments on commit 093cc46

Please sign in to comment.