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

django.template.exceptions.TemplateDoesNotExist: rest_framework/api.html报错,
我在使用postman进行提交请求是能正常调用的,可是使用浏览器就会抛出这个错误
在这里插入图片描述
这是由于咱们没在settings中的app中注册咱们的rest_framework致使的。
只需在html

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',
]

注册一下便可正常访问了。web

相关文章
相关标签/搜索