Changes between Initial Version and Version 2 of Ticket #24922


Ignore:
Timestamp:
Jun 4, 2015, 10:01:46 AM (9 years ago)
Author:
Sergei Maertens
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24922

    • Property Owner changed from nobody to Sergei Maertens
    • Property Status newassigned
  • Ticket #24922 – Description

    initial v2  
    55    {
    66        'BACKEND': 'django.template.backends.django.DjangoTemplates',
    7         'DIRS': [],
     7        'DIRS': [os.path.join(BASE_DIR, 'templates')],
    88        'APP_DIRS': True,
    99        'OPTIONS': {
     
    1414                'django.contrib.messages.context_processors.messages',
    1515            ],
     16            'loaders': [
     17                ('django.template.loaders.cached.Loader', [
     18                    'django.template.loaders.filesystem.Loader',
     19                    'django.template.loaders.app_directories.Loader',
     20                ]),
     21            ],
    1622        },
    17         'loaders': [
    18             ('django.template.loaders.cached.Loader', [
    19                 'django.template.loaders.filesystem.Loader',
    20                 'django.template.loaders.app_directories.Loader',
    21             ]),
    22         ],
    2323    },
    2424]
    2525}}}
    2626
     27urls.py:
     28{{{#!python
     29from django.conf.urls import include, url
     30from django.contrib import admin
     31
     32from django.views.generic import TemplateView
     33
     34urlpatterns = [
     35    url(r'^admin/', include(admin.site.urls)),
     36    url(r'^$', TemplateView.as_view(template_name='test.html')),
     37]
     38}}}
     39
     40Test template is just an empty file
     41
    2742Error:
    2843{{{
    29 Traceback (most recent call last):
    30   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
    31     response = self.get_response(request)
    32   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/core/handlers/base.py", line 218, in get_response
    33     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
    34   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/core/handlers/base.py", line 268, in handle_uncaught_exception
    35     return callback(request, **param_dict)
    36   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    37     response = view_func(request, *args, **kwargs)
    38   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/views/defaults.py", line 42, in server_error
    39     template = loader.get_template(template_name)
    40   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/template/loader.py", line 29, in get_template
    41     engines = _engine_list(using)
    42   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/template/loader.py", line 144, in _engine_list
    43     return engines.all() if using is None else [engines[using]]
    44   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/template/utils.py", line 110, in all
    45     return [self[alias] for alias in self]
    46   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/template/utils.py", line 101, in __getitem__
    47     engine = engine_cls(params)
    48   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/template/backends/django.py", line 24, in __init__
    49     self.engine = Engine(self.dirs, self.app_dirs, **options)
    50   File "/home/modelbrouw/.virtualenvs/staging/lib/python2.7/site-packages/django/template/engine.py", line 36, in __init__
    51     "app_dirs must not be set when loaders is defined.")
    52 django.core.exceptions.ImproperlyConfigured: app_dirs must not be set when loaders is defined.
     44Environment:
     45
     46
     47Request Method: GET
     48Request URL: http://localhost:8000/
     49
     50Django Version: 1.8.2
     51Python Version: 3.4.3
     52Installed Applications:
     53('django.contrib.admin',
     54 'django.contrib.auth',
     55 'django.contrib.contenttypes',
     56 'django.contrib.sessions',
     57 'django.contrib.messages',
     58 'django.contrib.staticfiles')
     59Installed Middleware:
     60('django.contrib.sessions.middleware.SessionMiddleware',
     61 'django.middleware.common.CommonMiddleware',
     62 'django.middleware.csrf.CsrfViewMiddleware',
     63 'django.contrib.auth.middleware.AuthenticationMiddleware',
     64 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
     65 'django.contrib.messages.middleware.MessageMiddleware',
     66 'django.middleware.clickjacking.XFrameOptionsMiddleware',
     67 'django.middleware.security.SecurityMiddleware')
     68
     69
     70Traceback:
     71File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
     72  164.                 response = response.render()
     73File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/response.py" in render
     74  158.             self.content = self.rendered_content
     75File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/response.py" in rendered_content
     76  133.         template = self._resolve_template(self.template_name)
     77File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/response.py" in _resolve_template
     78  88.         new_template = self.resolve_template(template)
     79File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/response.py" in resolve_template
     80  78.             return loader.select_template(template, using=self.using)
     81File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/loader.py" in select_template
     82  57.     engines = _engine_list(using)
     83File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/loader.py" in _engine_list
     84  144.     return engines.all() if using is None else [engines[using]]
     85File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/utils.py" in all
     86  110.         return [self[alias] for alias in self]
     87File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/utils.py" in <listcomp>
     88  110.         return [self[alias] for alias in self]
     89File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/utils.py" in __getitem__
     90  101.             engine = engine_cls(params)
     91File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/backends/django.py" in __init__
     92  24.         self.engine = Engine(self.dirs, self.app_dirs, **options)
     93File "/home/bbt/coding/.virtualenvs/tpl_app_dirs/lib/python3.4/site-packages/django/template/engine.py" in __init__
     94  36.                     "app_dirs must not be set when loaders is defined.")
     95
     96Exception Type: ImproperlyConfigured at /
     97Exception Value: app_dirs must not be set when loaders is defined.
    5398}}}
Back to Top