问题1
django.core.exceptions.ImproperlyConfigured:
The TEMPLATE_DIRS setting must be a tuple. Please fix your settings [closed]
解决方法:
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, ‘templates’), #!!注意os.path()后面的逗号不能少
)
问题2
Django TemplateDoesNotExist
解决方法:
将 os.path.join(SETTINGS_PATH, ‘templates’)加入DIRS
修改后如下:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(SETTINGS_PATH, 'templates')], ##!!修改这里
'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',
],
},
},
]