在django3.2中,我尝试使用它来定位和加载模板? 但对我不起作用
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ` [BASE_DIR / 'templates']`,
}
默认设置如下:
`from pathlib import Path`
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
有什么问题的线索吗
如果要更改模板路径,可以在settings.py中使用它,例如,我在项目根目录中有一个模板的“templates”目录:
试用
相关问题 更多 >
编程相关推荐