本文整理汇总了Python中django.http.response.HttpResponse.delete_cookie方法的典型用法代码示例。如果您正苦于以下问题:Python HttpResponse.delete_cookie方法的具体用法?Python HttpResponse.delete_cookie怎么用?Python HttpResponse.delete_cookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.http.response.HttpResponse
的用法示例。
在下文中一共展示了HttpResponse.delete_cookie方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unlogin
# 需要导入模块: from django.http.response import HttpResponse [as 别名]
# 或者: from django.http.response.HttpResponse import delete_cookie [as 别名]
def unlogin(self):
r=HttpResponse()
r.delete_cookie("userlogin_username")
r.write("<script>self.location='/index/index'</script>")
return r
示例2: post
# 需要导入模块: from django.http.response import HttpResponse [as 别名]
# 或者: from django.http.response.HttpResponse import delete_cookie [as 别名]
def post(self, request, *args, **kwargs):
response = HttpResponse(json.dumps(self.save()), content_type="application/json")
response.delete_cookie('vparte1')
response.delete_cookie('vparte2')
response.delete_cookie('vparte3')
return response
示例3: logout
# 需要导入模块: from django.http.response import HttpResponse [as 别名]
# 或者: from django.http.response.HttpResponse import delete_cookie [as 别名]
def logout(request):
auth_logout(request)
response = HttpResponse(json.dumps({'detail': 'Logged out'}))
response.delete_cookie('csrftoken')
response.delete_cookie('sessionid')
return response