2018年12月16日
摘要: 一、Django中的缓存的几种方法 1)单个视图缓存。时间测试 import time from django.views.decorators.cache import cache_page @cache_page(5) # 缓存5秒 def test_time(request): ctime=t 阅读全文
posted @ 2018-12-16 22:35 可口_可乐 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 一、redis在Python下的基本使用 1)安装 pip install redis 2) 简单的使用测试 import redis r = redis.Redis(host='127.0.0.1', port=6379) r.set('foo', 'Bar') print(r.get('foo' 阅读全文
posted @ 2018-12-16 22:19 可口_可乐 阅读(307) 评论(0) 推荐(0) 编辑