检测Cookies是否存

检测Cookies是否存在:    if request.COOKIES.has_key('h1'):             response.write('

' + request.COOKIES['h1'] + '

')
Error:AttributeError:'dict' object has no attribute 'has_key' 原因:python3.x中没有has_key 解决办法:'h1' in request.COOKIES

你可能感兴趣的:(Django)