def ajax(f):
"""
Enforces the use of AJAX requests to access a resource. (Raises HTTPNotFound otherwise)
"""
@wraps(f)
async def wrapped(request):
if not is_ajax(request):
raise HTTPNotFound()
return await f(request)
return wrapped
评论列表
文章目录