Skip to content

Commit

Permalink
Better example of loading templates (i.e. not with jingo)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumar303 committed Oct 11, 2011
1 parent 091b65d commit 2c1802b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/examples/views.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Example views. Feel free to delete this app."""

from django import http
from django.shortcuts import render

import bleach
import commonware
from mobility.decorators import mobile_template
import jingo
from session_csrf import anonymous_csrf


Expand All @@ -17,7 +17,7 @@ def home(request, template=None):
"""Main example view."""
data = {} # You'd add data here that you're sending to the template.
log.debug("I'm alive!")
return jingo.render(request, template, data)
return render(request, template, data)


@anonymous_csrf
Expand All @@ -33,4 +33,4 @@ def bleach_test(request):
if bleachme:
data['bleached'] = bleach.clean(bleachme, tags=allowed_tags)

return jingo.render(request, 'examples/bleach.html', data)
return render(request, 'examples/bleach.html', data)
7 changes: 7 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
'examples',
]


# Because Jinja2 is the default template loader, add any non-Jinja templated
# apps here:
JINGO_EXCLUDE_APPS = [
'admin',
]

# Tells the extract script what files to look for L10n in and what function
# handles the extraction. The Tower library expects this.

Expand Down
2 changes: 1 addition & 1 deletion vendor
Submodule vendor updated 2 files
+1 −1 src/funfactory
+1 −1 src/jingo

0 comments on commit 2c1802b

Please sign in to comment.