Support for Django template engine subclasses
See original GitHub issuehttps://github.com/divio/django-cms/blob/release/3.4.x/cms/utils/setup.py#L21
try:
django_backend = [x for x in settings.TEMPLATES
if x['BACKEND'] == 'django.template.backends.django.DjangoTemplates'][0]
except IndexError:
raise ImproperlyConfigured("django CMS requires django.template.context_processors.request in "
"'django.template.backends.django.DjangoTemplates' context processors.")
This is insane! You forbid usage of customized engines.
Why don’t you check if django.template.context_processors.request
is in the list of context_processors
instead?
if 'django.template.context_processors.request' not in x['OPTIONS']['context_processors']:
raise ImproperlyConfigured("django CMS requires django.template.context_processors.request in "
"'django.template.backends.django.DjangoTemplates' context processors.")
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Support for Django template engine subclasses #5730
try: django_backend = [x for x in settings.TEMPLATES if x['BACKEND'] == 'django.template.backends.django.DjangoTemplates'][0] except ...
Read more >Templates | Django documentation
Support for template engines¶. Configuration¶. Templates engines are configured with the TEMPLATES setting. It's a list of configurations, one for ...
Read more >The Django template language: for Python programmers
It assumes an understanding of templates, contexts, variables, tags, and rendering. Start with the introduction to the Django template language if you ...
Read more >Class-based views
Django has a generic view to do this - TemplateView - so we can subclass it, and override the ... and how to...
Read more >Templates | Documentation de Django
admin, use the DTL. For historical reasons, both the generic support for template engines and the implementation of the Django template language live...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@barseghyanartur For the record, starting a bug report by telling people that their code is insane isn’t the best way to get help. May I suggest “this is incorrect” or “this could be improved” instead? Thanks.
@aaugustin:
You’re right, man! Approach positively.
@yakky:
Sorry for being rude, if I might have sounded so.