限制请求 from django.views.decorators.ttp import require_http_methods,require_GET 引入限制装饰器@require_http_methods(["GET"]),这个可以传递多个请求方式@require_GET只允许get请求@require_POST只允许post请求@require_salf允许get喝hand的请求使用@csrf_exempt装饰器可以对单个函数不验证csrf 使用时需要导入from django.views.decorators.csrf import csrf_exempt