限制请求方式装饰器

from django.views.decorators.http import require_http_methods,require_GET,require_POST,require_safe

@require_GET = @require_http_methods(['GET'])
@require_POST = @require_http_methods(['POST'])
@require_safe = @require_http_methods(['GET','HEAD'])
posted @ 2020-01-09 16:35  xsan  阅读(144)  评论(0编辑  收藏  举报