摘要: http://mirrors.sohu.com/mysql/ http://mirrors.sohu.com/ 阅读全文
posted @ 2020-04-19 21:48 real-admin 阅读(3123) 评论(0) 推荐(0) 编辑
摘要: from io import BytesIO from django.core.files.storage import FileSystemStorage from django.core.files.uploadedfile import InMemoryUploadedFile from PI 阅读全文
posted @ 2020-04-06 23:07 real-admin 阅读(102) 评论(0) 推荐(0) 编辑
摘要: def test(request): t = '2019-12-23 16:25:00' a = datetime.strptime(t, '%Y-%m-%d %H:%M:%S') print(a) print(type(a)) objs = Author.objects.filter(time__ 阅读全文
posted @ 2019-12-24 00:33 real-admin 阅读(95) 评论(0) 推荐(0) 编辑
摘要: # coding:utf-8 import requests import time import os url = "http://file.finance.sina.com.cn/211.154.219.97:9494/MRGG/CNSESH_STOCK/2018/2018-3/2018-03- 阅读全文
posted @ 2019-12-23 01:07 real-admin 阅读(382) 评论(0) 推荐(0) 编辑
摘要: from concurrent.futures import ThreadPoolExecutor # 导入线程池 from threading import current_thread # 从线程中导入查看当前线程的方法 import time,random pool = ThreadPoolE 阅读全文
posted @ 2019-12-20 00:44 real-admin 阅读(114) 评论(0) 推荐(0) 编辑
摘要: import requests import time url = 'http://www.google.com.hk' print(time.strftime('%Y-%m-%d %H:%M:%S')) try: html = requests.get(url, timeout=5).text p 阅读全文
posted @ 2019-12-19 01:34 real-admin 阅读(233) 评论(0) 推荐(0) 编辑
摘要: authors = Author.objects.filter(name="小非").first()if authors: print(authors.__dict__) info_dic = authors.__dict__ info_dic.pop("_state") a = json.dump 阅读全文
posted @ 2019-12-10 00:46 real-admin 阅读(573) 评论(0) 推荐(0) 编辑
摘要: 一切情况,优先考虑pymysql,兼容性更好,特殊字符和中文不容易出现乱码。 mysqldb对中文兼容性不好,且对python3.5以后的版本不支持。 阅读全文
posted @ 2019-12-05 00:00 real-admin 阅读(676) 评论(0) 推荐(0) 编辑
摘要: import pymysql con = pymysql.connect(host="127.0.0.1",user="root",passwd="root",db="test") cursor = con.cursor() sql = "insert into test2(name,gender) 阅读全文
posted @ 2019-12-03 00:23 real-admin 阅读(138) 评论(0) 推荐(0) 编辑
摘要: django 文件更新: 文件更新一定要放到最后,否则文件会丢失! 参考https://blog.csdn.net/weixin_33127753/article/details/88227832 from django.core.files.base import ContentFile file 阅读全文
posted @ 2019-11-29 01:14 real-admin 阅读(268) 评论(0) 推荐(0) 编辑