Skip to content

Instantly share code, notes, and snippets.

@ArcTanSusan
Last active December 21, 2015 12:09
Show Gist options
  • Save ArcTanSusan/6303797 to your computer and use it in GitHub Desktop.
Save ArcTanSusan/6303797 to your computer and use it in GitHub Desktop.
I'm not sure how to use the settings.TEMPLATE_LOADERS. Gah.
I'm not quite sure how to use the settings.TEMPLATE_LOADERS in L110:
settings.TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
)
),
)
Inside the test_loaders.py, I do a dir(loader) using pdb. And here are its methods:
['BaseLoader', 'Context', 'ImproperlyConfigured', 'LoaderOrigin', 'Origin', 'Template',
'TemplateDoesNotExist', '__builtins__', '__doc__', '__file__', '__name__', '__package__',
'add_to_builtins', 'find_template', 'find_template_loader', 'get_template', 'get_template_from_string',
'import_by_path', 'make_origin', 'render_to_string', 'select_template', 'settings', 'six', 'template_source_loaders']
No sign of reset() or load_template() here.
Why? Because the variable name "loader" comes from L25: from "django.template import loader",
rather than from django.template.loaders.cached. I'm stumped on how to fix this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment