## mysite/mysite/settings.py
## mysite是项目名
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')], # 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',
],
},
},
]
这个templates文件夹是放在project的目录下面的,是项目中或者说项目中所有的应用公用的一些模板
## mysite/mysite/settings.py
## mysite/app1/
## mysite是项目名字,app1是应用名字
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'