djmako

Mako template support for Django 1.2
Download

djmako Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Jacob Smullyan
  • Publisher web site:
  • http://www.bitbucket.org/smulloni/

djmako Tags


djmako Description

Mako template support for Django 1.2 Portions of this code are taken from django-smorgasbord's mako support. Smorgasbord provided a monkeypatch to facilitate the use of other templating languages within Django 1.1; with Django 1.2, this monkeypatch is no longer necessary, and there is no longer any particular reason to conjoin template loaders for different languages in one project.To use, add 'djmako.MakoLoader' to settings.TEMPLATE_LOADERS, and define settings.MAKO_TEMPLATE_DIRS (a tuple of directories in which to look for mako templates -- required) and settings.MAKO_TEMPLATE_OPTS (a dictionary of other parameters to pass to Mako's TemplateLookup class -- optional).For instance, in settings.py you might have:TEMPLATE_LOADERS = ( 'djmako.MakoLoader', 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader',)MAKO_TEMPLATE_DIRS=(os.path.join(PROJECT_ROOT, 'templates', 'mako'),)MAKO_TEMPLATE_OPTS=dict(input_encoding='utf-8', module_directory=os.path.join( tempfile.gettempdir(), os.environ.get('LOGNAME', 'someuser'), 'mysite', PROJECT_ROOT.split('/')))Note that in the above configuration, the mako loader is checked first, and django templates afterwards. Requirements: · Python · Django


djmako Related Software