上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 34 下一页
摘要: from datetime import datetime from datetime import timedelta # 1) 获取当前日期和时间 today = datetime.today() # 返回当前时间时分秒都为0 print("当前时间") print(today) today1 阅读全文
posted @ 2020-11-17 18:10 pythoner_wl 阅读(53) 评论(0) 推荐(0)
摘要: curl ifconfig.me curl cip.cc 阅读全文
posted @ 2020-11-17 12:29 pythoner_wl 阅读(82) 评论(0) 推荐(0)
摘要: pop(key[,default]) d = {'a':1,'b':2,'c':3} 删除key值为'a'的元素,并赋值给变量e1 e1 = d.pop('a') 如果key不存在,则可以设置返回值 e2 = d.pop('m','404') 如果key不存在,不设置返回值就报错 e3 = d.po 阅读全文
posted @ 2020-11-17 11:28 pythoner_wl 阅读(330) 评论(0) 推荐(0)
摘要: docker端口映射 查看端口占用情况: lsof -i:8000 端口被占用了 port is already allocated. 查看docker容器,端口映射情况 docker port 容器名字 启动容器:端口映射 docker run -dit -p 8000:8000 --name=l 阅读全文
posted @ 2020-11-17 11:26 pythoner_wl 阅读(204) 评论(0) 推荐(0)
摘要: 运行django项目,报错:时区 docker cp /etc/localtime 324149831bcd:/etc/localtime docker cp /usr/share/zoneinfo/Asia/Shanghai 324149831bcd:/etc/localtime 还是报错: Er 阅读全文
posted @ 2020-11-17 10:36 pythoner_wl 阅读(159) 评论(0) 推荐(0)
摘要: docker docker pull silverlogic/python3.6 创建容器 docker run [option] 镜像名 [向启动容器中传入的命令]1 常用可选参数说明: -i 表示以“交互模式”运行容器 -t 表示容器启动后会进入其命令行。加入这两个参数后,容器创建就能登录进去。 阅读全文
posted @ 2020-11-16 12:25 pythoner_wl 阅读(97) 评论(0) 推荐(0)
摘要: 如果我们有这样一个model: class IPInfoModel(models.Model): TYPE_INTRANET = 1 TYPE_INTERNET = 2 IP_TYPES = ( (TYPE_INTRANET, u'内网'), (TYPE_INTERNET, u'外网'), ) ip 阅读全文
posted @ 2020-11-12 14:58 pythoner_wl 阅读(643) 评论(0) 推荐(0)
摘要: 登录认证: class Login(APIView): """登录接口""" def post(self, request, version): msg = {'code': status.OK, 'message': '操作成功', 'data': ''} print(request.user) 阅读全文
posted @ 2020-11-12 14:56 pythoner_wl 阅读(585) 评论(0) 推荐(0)
摘要: drf:过滤,查找,排序 字段过滤 一般过滤可以重写get_queryset方法实现,这时候就可以去掉queryset这个属性了:`` [] class GoodsListViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): seriali 阅读全文
posted @ 2020-11-12 12:17 pythoner_wl 阅读(329) 评论(0) 推荐(0)
摘要: 详解django-apscheduler的使用方法 2020-02-17阅读 2.1K0 如果你在使用Django框架开发web项目时,需要设置定时任务或让用户手动在页面上设置定时任务,那么这篇文章可能会帮助到你。 概述 在Django中实现定时任务功能大概有以下三种方法: Celery框架 定时任 阅读全文
posted @ 2020-11-11 16:23 pythoner_wl 阅读(568) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 34 下一页