用于控制请求类型的装饰器的导入 require_http_methods 限定只允许GET请求访问 @require_http_methods([请求方法1,请求方法2]) def 视图函数名(): 效果 get 请求允许 post请求不允许 只允许get请求 require_GET