摘要: 零、linux中安装设置 启动redis service redis start 停止redis service redis stop 查看状态 service redis status/systemctl status redis 查看进程 ps -ef | grep redis 设置开机启动 c 阅读全文
posted @ 2020-04-15 19:20 阿木木的木 阅读(710) 评论(0) 推荐(0) 编辑
摘要: 0、linux中mariadb linux上安装Mariadb设置参考 : https://www.cnblogs.com/keithtt/p/6922378.html 开启服务 systemctl start mariadb 查看服务 systemctl status mariadb 停止服务 s 阅读全文
posted @ 2020-04-15 19:18 阿木木的木 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 实现单例模式,及python程序在调用某一个类的时候,永远只出现一个实例(可以节约内存,CPU): 1,通过包的形式写在外面以import的形式导入,最直接。 2,以__new__方法创建单例模式,代码如下: class Singleton(object): def __init__(self): 阅读全文
posted @ 2020-04-15 17:49 阿木木的木 阅读(197) 评论(0) 推荐(0) 编辑
摘要: django中创建cache.py,写如下代码from redis import Redis from django.conf import settings class MSRedis(object): '''读写分离客户端(只针对程序中用到的命令)''' def __init__(self,co 阅读全文
posted @ 2020-04-15 17:22 阿木木的木 阅读(430) 评论(1) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-04-15 17:01 阿木木的木 阅读(226) 评论(0) 推荐(0) 编辑