摘要: 1. Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程 daemonize no 2. 当Redis以守护进程方式运行时,Redis默认会把pid写入/var/run/redis.pid文件,可以通过pidfile指定 pidfile /var/run/redis 阅读全文
posted @ 2020-06-23 11:34 明知山有小脑斧 阅读(192) 评论(0) 推荐(0)
摘要: 1 import java.sql.Timestamp; 2 import java.time.format.DateTimeFormatter; 3 import java.util.Calendar; 4 import java.util.Date; 5 6 /** 7 * 时间公共类 8 */ 阅读全文
posted @ 2020-06-23 10:45 明知山有小脑斧 阅读(334) 评论(0) 推荐(0)
摘要: python 内置首字母大写的方法title(),可以满足一般的需求 ,但是title()方法 会把除了首字母之外的字母变为小写 ,这时候就需要自定义首字母大写的方法了 1 # 首字母大写 2 def firstUp(title): 3 new_str = '{}{}'.format(title[0 阅读全文
posted @ 2020-06-23 10:11 明知山有小脑斧 阅读(2265) 评论(0) 推荐(0)
摘要: 在settings.py 中配置: 1 LANGUAGE_CODE = 'zh-Hans' 2 3 TIME_ZONE = 'Asia/Shanghai' 4 5 USE_TZ = False 阅读全文
posted @ 2020-06-23 08:43 明知山有小脑斧 阅读(286) 评论(0) 推荐(0)
摘要: 在settings.py 配置数据库连接 1 DATABASES = { 2 'default': { 3 'ENGINE': 'django.db.backends.mysql', 4 'NAME': 'django_db', 5 'USER': 'root', 6 'PASSWORD': 'ro 阅读全文
posted @ 2020-06-23 08:32 明知山有小脑斧 阅读(152) 评论(0) 推荐(0)