i am new in Django i want change my Django Template path . but they are set by dafault a path in setting.py then i import os but it will not working
i am new in Django i want change my Django Template path . but they are set by dafault a path in setting.py then i import os but it will not working
I understand you want to change the directory for templates, then do the following. Override variable and path to search for templates:
BASE_DIR = Path(__file__).resolve().parent.parent
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'Templates'], # change this
'APP_DIRS': False, #false only if you don't use it
'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',
],
},
},
]