限制请求方式装饰器
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'])