根据 用户请求URL 或 用户可接受的类型,筛选出合适的 渲染组件. 用户请求头: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 一.JSON 1.urls.py from django.urls import path, re_path, include from api.views import TestView2 urlpatterns = [ re_…