TemplateDoesNotExist: first/test.html DJango 1.8

28 views
Skip to first unread message

Jose Paul

unread,
Nov 12, 2015, 8:04:53 AM11/12/15
to Django users
I am getting several TemplateDoesNotExist .like below .

======================================================================
ERROR: test_pickling (template_tests.test_response.SimpleTemplateResponseTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\test_response.py", line 178, in test_pickling
    response.render()
  File "C:\Python27\lib\site-packages\django\template\response.py", line 158, in render
    self.content = self.rendered_content
  File "C:\Python27\lib\site-packages\django\template\response.py", line 133, in rendered_content
    template = self._resolve_template(self.template_name)
  File "C:\Python27\lib\site-packages\django\template\response.py", line 88, in _resolve_template
    new_template = self.resolve_template(template)
  File "C:\Python27\lib\site-packages\django\template\response.py", line 80, in resolve_template
    return loader.get_template(template, using=self.using)
  File "C:\Python27\lib\site-packages\django\template\loader.py", line 46, in get_template
    raise TemplateDoesNotExist(template_name)
TemplateDoesNotExist: first/test.html

Here is my setting.py ,seems I am missing something here .

BASE_TEST_DIR = os.path.join(BASE_DIR,'tests')

 
TEMPATE_TESTS = os.path.join(BASE_TEST_DIR,'template_tests')
TEMPATE_LODER=os.path.join(BASE_TEST_DIR,'template_loader')
TEMPATE_BACKENDS=os.path.join(BASE_TEST_DIR,'template_backends')
TEST_UTILS=os.path.join(BASE_TEST_DIR,'test_utils')
TEST_CLIENT_REGRESS=os.path.join(BASE_TEST_DIR,'test_client_regress')

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [ os.path.join(BASE_TEST_DIR, 'templates'), 
                 os.path.join(TEMPATE_BACKENDS, 'templates'),
                 os.path.join(TEMPATE_TESTS, 'templates'),
                 os.path.join(TEST_UTILS, 'templates'),
                 os.path.join(TEST_CLIENT_REGRESS, 'templates'),
                 os.path.join(TEMPATE_LODER, 'templates'),],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.debug',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]


I can see the " templates" folder in  following path .Following variables are initialized correctly .
All these folders have " templates" folder .
 
TEMPATE_TESTS = os.path.join(BASE_TEST_DIR,'template_tests')
TEMPATE_LODER=os.path.join(BASE_TEST_DIR,'template_loader')
TEMPATE_BACKENDS=os.path.join(BASE_TEST_DIR,'template_backends')
TEST_UTILS=os.path.join(BASE_TEST_DIR,'test_utils')
TEST_CLIENT_REGRESS=os.path.join(BASE_TEST_DIR,'test_client_regress')

Please help 


Reply all
Reply to author
Forward
0 new messages