首页 > 其他分享 >django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html

django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html

时间:2023-02-26 10:12:14浏览次数:104  
标签:TemplateDoesNotExist rest django framework api contrib html

django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html报错,
使用postman进行提交请求是能正常调用的,但是使用浏览器就会抛出这个错误

这是因为没在settings中的app中注册rest_framework
只需在
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app01.apps.App01Config',
'rest_framework',
]

注册一下即可正常访问了。

标签:TemplateDoesNotExist,rest,django,framework,api,contrib,html
From: https://www.cnblogs.com/frantichow/p/17156176.html

相关文章