Skip to content

comoga/django-djinja2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Jinja2 template engine integration.

Features

  • Template loaders
  • makemessages_jinja command
  • test runner

Installation

Djinja2 requires Django 1.3 and chouwa.

pip install chouwa

Install from here using pip:

pip install -e git+git://github.com/comoga/django-djinja2#egg=django-djinja2

Configuration

Modify your settings.py. Add djinja2 app to your INSTALLED_APPS.

Configure template loaders. Djinja2 loader must come before django original loaders.

TEMPLATE_LOADERS = (
    'djinja2.loaders.filesystem.Loader',
    'djinja2.loaders.app_directories.Loader',
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

Exclude non-jinja (admin site ...) templates with KEEP_DJANGO_TEMPLATES option in your settings. Djinja2 loaders skip any template which path begins with specified prefixes. For example to skip admin site templates use:

KEEP_DJANGO_TEMPLATES = (
    'admin/',
)

Optionally run tests with Jinja2TestSuiteRunner to have correctly instrumented template render.

Usage

You can use all Jinja2 and chouwa features (chouwa decorators, jinja_globals.py in each app ...)

To create or update a localization message file use makemessagesjinja command instead.

About

Django Jinja2 template engine integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages