摘要:
一次性响应:HttpResponse类及其子类、JsonResponse类 流式响应:SteamingHttpResponse类、FileResponse类 文件下载为例 #HttpResponse方式,文件内容一次性响应,仅适合小文件 def file_download(request): wit 阅读全文
摘要:
django.views.decorators.http 路由不能判断HTTP请求的类型 Django通过decorators在视图函数前进行基本判断,格式如下: 这段代码my_view实现只处理GET和POST方法,其他方法将被过滤掉 from django.views.decorators.ht 阅读全文