📜  需要 http 方法 django view - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:14.848000             🧑  作者: Mango

代码示例1
from django.views.decorators.http import require_http_methods

@require_http_methods(["GET", "POST"])
def my_view(request):
    # I can assume now that only GET or POST requests make it this far
    # ...
    pass