question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Django template engine subclasses

See original GitHub issue

https://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:open
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
aaugustincommented, Oct 18, 2016

@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.

2reactions
barseghyanarturcommented, Oct 19, 2016

@aaugustin:

You’re right, man! Approach positively.

@yakky:

Sorry for being rude, if I might have sounded so.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found