01 2022 档案
摘要:首先在cofing里面配置 SECRET_KEY = 'cbfnb'MAIL_SERVER = 'smtp.163.com'#电子邮件服务器的主机名或IP地址MAIL_PORT = '25' #电子邮件服务器的端口MAIL_USE_TLS = True#启用传输层安全MAIL_USERNAME =
阅读全文
摘要:import time,datetime#时间戳timestamp=int(time.time())# #转换成localtimetime_local=time.localtime(timestamp)# #转换成时间格式:%Y_%m_%d %H:%M:%Sdt=time.strftime("%Y-
阅读全文
摘要:def xtree(data): list = [] dict = {} if data: for j in data: dict[j['id']] = j for i in data: if i['pid'] == 0: list.append(i) else: if 'son' not in d
阅读全文
摘要:import osimport uuidclass MyFiles: #指定文件操作目录 def __init__(self,upload_dir='./static/upload/'): self.up_dir = upload_dir #创建文件夹 def mk_dir(self,userid)
阅读全文
摘要:@app.route('/getpic')def getpic(): name, text,image=captcha.generate_captcha() res = make_response(image) res.content_type='image/png' return res除了这些在
阅读全文
摘要:import redisclass Redis: def __init__(self): self.conn = redis.Redis(host='localhost', port=6379) # 存 def set_str(self, mobile, codes, time=0): if tim
阅读全文