#24922: Templates: conflicting settings should emit a system check error
--------------------------------------+------------------------------------
     Reporter:  sergei-maertens       |      Owner:  nobody
         Type:  Bug                   |     Status:  new
    Component:  Core (System checks)  |    Version:  master
     Severity:  Normal                |   Keywords:  templates, system
                                      |  check
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+------------------------------------
 I discovered that specifying the templates settings as following, raises
 an error when rendering the template:

 {{{#!python
 TEMPLATES = [
     {
         'BACKEND': 'django.template.backends.django.DjangoTemplates',
         'DIRS': [],
         'APP_DIRS': True,
         'OPTIONS': {
             'context_processors': [
                 'django.template.context_processors.debug',
                 'django.template.context_processors.request',
                 'django.contrib.auth.context_processors.auth',
                 'django.contrib.messages.context_processors.messages',
             ],
         },
         'loaders': [
             ('django.template.loaders.cached.Loader', [
                 'django.template.loaders.filesystem.Loader',
                 'django.template.loaders.app_directories.Loader',
             ]),
         ],
     },
 ]
 }}}

 Error:
 {{{
 Traceback (most recent call last):
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/core/handlers/wsgi.py", line 189, in __call__
     response = self.get_response(request)
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/core/handlers/base.py", line 218, in get_response
     response = self.handle_uncaught_exception(request, resolver,
 sys.exc_info())
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/core/handlers/base.py", line 268, in
 handle_uncaught_exception
     return callback(request, **param_dict)
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/utils/decorators.py", line 110, in _wrapped_view
     response = view_func(request, *args, **kwargs)
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/views/defaults.py", line 42, in server_error
     template = loader.get_template(template_name)
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/template/loader.py", line 29, in get_template
     engines = _engine_list(using)
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/template/loader.py", line 144, in _engine_list
     return engines.all() if using is None else [engines[using]]
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/template/utils.py", line 110, in all
     return [self[alias] for alias in self]
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/template/utils.py", line 101, in __getitem__
     engine = engine_cls(params)
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/template/backends/django.py", line 24, in __init__
     self.engine = Engine(self.dirs, self.app_dirs, **options)
   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-
 packages/django/template/engine.py", line 36, in __init__
     "app_dirs must not be set when loaders is defined.")
 django.core.exceptions.ImproperlyConfigured: app_dirs must not be set when
 loaders is defined.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24922>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/058.352ad55c1dfd45f588d2366483ec54f3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to