摘要: 国际化配置 自定义User表 models.py settings.py admin.py pip换源 MEDIA相关配置 urls.py settings.py 数据库相关配置 settings.py 阅读全文
posted @ 2020-02-25 19:05 GhostAnt 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 批量注释 Ctrl + / 集体缩进选中缩进代码 TAB 取消缩进 Shift + TAB 多行同步输入 alt+shift+光标 代码定位到报错处 F2 formatted整理代码 Ctrl + alt + L 阅读全文
posted @ 2019-10-31 17:26 GhostAnt 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 前言 Metrics和Tracing属于开箱即用的一套API,其目的是为了监控、跟踪程序调用。本身使用起来很简单,但希望通过这篇文章,让使用者能明白其工作原理和更好的使用。 Metrics、Tracing和Logging logging应该是我们最熟悉的一个组成,其目的是在于记录程序运行的状态,便于 阅读全文
posted @ 2021-11-16 13:25 GhostAnt 阅读(1468) 评论(0) 推荐(0) 编辑
摘要: 一、Nginx安装 1.yum安装 cat >/etc/yum.repos.d/nginx.repo<<EOF [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/x86_64 gpgcheck=0 enabled=1 阅读全文
posted @ 2021-05-10 09:13 GhostAnt 阅读(191) 评论(0) 推荐(0) 编辑
摘要: import threading import time import logging class TimeoutWrapper(object): def __init__(self, timeout, process): self.timeout = timeout self.timer = No 阅读全文
posted @ 2021-04-14 10:44 GhostAnt 阅读(72) 评论(0) 推荐(0) 编辑
摘要: import threading import os class LockedFile(object): SETUP_LOGGER_LOCK = threading.Lock() LOGFILES = {} @classmethod def open(cls, fn): with cls.SETUP 阅读全文
posted @ 2021-04-14 10:22 GhostAnt 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 一、Consul Connect tips: -dev 1.service definition counting.json { "service": { "name": "counting", "id": "counting-1", "port": 9003, "check": { "http": 阅读全文
posted @ 2021-04-08 22:46 GhostAnt 阅读(159) 评论(0) 推荐(0) 编辑
摘要: from contextlib import contextmanager class Test(object): pass ctx = Test() @contextmanager def do_with_log(log_file_path): try: ctx.log = open(log_fi 阅读全文
posted @ 2020-07-13 11:16 GhostAnt 阅读(128) 评论(0) 推荐(0) 编辑
摘要: sudo apt install gnome tweak tool 搜索tewak 阅读全文
posted @ 2020-05-07 19:39 GhostAnt 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2020.cnblogs.com/blog/1853305/202004/1853305-20200413152508793-36962702.png) 阅读全文
posted @ 2020-04-13 15:26 GhostAnt 阅读(104) 评论(0) 推荐(0) 编辑
摘要: ```python ''' 对于有符号数而言: 1.二进制的最高位是符号位,0表示整数,1表示负数 2.正数的原码、反码、补码都一样(三码合一) 3.负数的反码=它的原码符号位不变,其他位取反 4.负数的补码=它的反码+1 5.0的反码补码都是0 6.计算机运算的时候,都是以补码的方式来运算的。 ''' ``` ```python ''' > 二进制右移运算符。将一个数的各二进制位全部右移若干位, 阅读全文
posted @ 2020-04-13 15:24 GhostAnt 阅读(145) 评论(0) 推荐(0) 编辑
摘要: ```html 1.下面这段代码的输出结果是什么,并给出你的解释 def index(): return [lambda x : i * x for i in range(4)] print([m(2) for m in index()]) 2.有一个列表[3,4,1,2,5,6,6,5,4,3,3]请写出一个函数,找出该列表中没有重复的数的总和 3.什么是函数的递归调用?书写递归函数需要注意什么 阅读全文
posted @ 2020-04-13 15:19 GhostAnt 阅读(121) 评论(0) 推荐(0) 编辑