drf框架安装配置及其功能概述

一.安装

pip3 install djangorestframework

二.配置

# 注册drf app
NSTALLED_APPS = [
    # ...
    'rest_framework',
]

三.特点

# 具体功能在具体模块下
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.exceptions import APIException
from rest_framework.filters import OrderingFilter
from rest_framework.views import APIView
from rest_framework.pagination import PageNumberPagination
from rest_framework.settings import APISettings

# 自定义drf配置 - 在自己的settings.py
REST_FRAMEWORK = {
    # 自定义修改drf的配置们
}

相关文章:

  • 2022-12-23
  • 2021-08-21
  • 2022-01-22
  • 2022-12-23
  • 2021-09-29
  • 2021-11-27
  • 2021-10-15
  • 2022-12-23
猜你喜欢
  • 2021-10-02
  • 2021-12-15
  • 2022-12-23
  • 2021-11-24
  • 2021-07-26
  • 2021-07-22
  • 2022-12-23
相关资源
相似解决方案