A
A
Artur Kudashev2019-01-26 15:46:09
Django
Artur Kudashev, 2019-01-26 15:46:09

Why is TEMPLATE_DIRS not working?

Hello, there is a blog project which has myblog application. The templates folder was located in myblog, but I decided to move it to the blog folder, now Django can't find the templates.
settings.py

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates'),
)

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [TEMPLATE_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',
            ],
        },
    },
]

/home/a0271128/domains/developerblog.ru/blog/myblog/templates/myblog/index.html - where Django looks for
templates
I don't know why it substitutes myblog after blog, maybe PROJECT_ROOT = '/home/a0271128/domains/developerblog.ru/blog/myblog/'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-01-26
@archi_kud

Because it's outdated .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question