1
votes

According to Django documentation

"Your project’s TEMPLATES setting describes how Django will load and render templates. The default settings file configures a DjangoTemplates backend whose APP_DIRS option is set to True. By convention DjangoTemplates looks for a “templates” subdirectory in each of the INSTALLED_APPS."

My Mezzanine settings.py has this configuration

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',
        ],
    },
},

]

My directory structure is

project
    app_name
        templates
            app_name
                index.html

But the template loader stops at

project
    app_name
        templates

As such my app_name template index.html is not reached. What can be the problem?

2

2 Answers

0
votes

Then you could reach your template with 'app_name/index.html'

0
votes

Did you try to change your template dirs on setting.py like this

'DIRS': ["templates"],

and did your views.py provide specific location of template E.g.

return render(request, 'foldername/templatename.html', {})