Skip to content

Instantly share code, notes, and snippets.

@rrader
Created August 17, 2015 13:15
Show Gist options
  • Select an option

  • Save rrader/602459d44ff8473ad3b3 to your computer and use it in GitHub Desktop.

Select an option

Save rrader/602459d44ff8473ad3b3 to your computer and use it in GitHub Desktop.
Use DjangoTemplates with custom loader independently of settings.py
engine = DjangoTemplates(
{
'NAME': 'mail',
'APP_DIRS': False,
'DIRS': [],
'OPTIONS': {
'loaders': [
'events.loaders.MyLoader',
],
},
})
template = engine.get_template(template_slug)
rendered = template.render(Context(...))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment