django中使用jinja2模板
(admin.E403) A ‘django.template.backends.django.DjangoTemplates’ instance must be configured in TEMPLATES in order to use the admin application.| 使用jinjia2时报错
TEMPLATES = [
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'DIRS': [os.path.join(BASE_DIR,'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',
],
'environment':'app.base_jinja2.environment' # 具体路径按照您实际的来
},
},
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, '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',
],
},
}
]
https://www.cnblogs.com/Bert-Sun/p/12575967.html
django中使用jinja2模板,配置及(admin.E403)错误解决
https://blog.csdn.net/qq_44982845/article/details/104818136
Django之Django模板与Jinja2模板的使用
https://blog.csdn.net/qq_38628046/article/details/126395642
https://blog.csdn.net/qq_44982845/article/details/104818136
关于如何在 django 2.2.7 版本更换模板引擎为 jinja2
https://coding.imooc.com/learn/questiondetail/jxkpVPBVkB0PrwRQ.html