【Django学习】加载site-packages下的template

问题1:

 

 

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',

# 'DIRS': ['frontend/dist'],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True, #需要设置为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',
],
},
},
]

问题2

 

 

 

 

 

 

REST-framework快速构建API--生成Swagger接口文档

https://blog.csdn.net/weixin_30496431/article/details/95587095

解决django配置swagger后,打开docs报错TypeError:Excepted a ‘coreapi.Document’ instance

https://www.cnblogs.com/chazi2020/p/14782003.html

 

posted @ 2022-12-03 00:21  gtea  阅读(27)  评论(0编辑  收藏  举报