摘要: 设置cookie 在响应对象中使用set_cookie方法设置cookie from django.http import HttpResponse def set_cookie(request): rsp = HttpResponse("set cookie") rsp.set_cookie("s 阅读全文
posted @ 2022-05-07 23:34 码上测 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 一、配置redis 在settings中添加配置参数 # Django的缓存配置 CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", # 声明使用redis作为缓存 "LOCATION": "redis://:123 阅读全文
posted @ 2022-05-07 23:14 码上测 阅读(331) 评论(0) 推荐(0) 编辑