python
weixin_44961798
这个作者很懒,什么都没留下…
展开
-
apscheduler报错maximum number of running instances
错误详情[WARNING] [apscheduler.scheduler] Execution of job "xxx” next run at: “xxx" skipped: maximum number of running instances reached (1)可能的原因模式为interval,设置的seconds小于任务执行所需时间,即上个任务还未执行完毕 调度器再次执行前检查发现超过设置的max_instances,解决方法:修改seconds...原创 2021-07-30 11:42:37 · 767 阅读 · 0 评论 -
Django模型主键类型是什么
in python2 django1.8, it may be longin python3 django2.2, it may be int原创 2021-05-19 17:39:33 · 73 阅读 · 0 评论 -
Clean Python note
命名规范1.使用_来表示私有化2.使用__来表区别内置(build-in)方法3.使用更显而易见的函数名和参数名def get_user_detail_by(user_id: int): pass原创 2021-05-13 22:44:34 · 52 阅读 · 0 评论 -
python使用reload进行热更新
python2.7+django1.8+ubuntu18.04因需求定期修改密码,每次修改完后手动更新配置,重启服务不现实,本人是在邮件密码遇见的坑。settings里的配置通过config.py配置文件中的CONF类动态获取,CONF读取配置文件conf.ini中的配置,然后密码更新后初始化一个CONF实例,调用set方法更新conf.ini里的信息这样更新完了django.setting...原创 2020-03-18 18:37:31 · 680 阅读 · 0 评论 -
django+proxy使用问题
最近项目中用到了mysql-proxy,在次记录遇到的问题环境:python2.7+django1.110.使用proxy无法查询,解决办法https://github.com/ssjunior/django/commit/52bf6c7630ab6b17a3a3ff64213e1ad36d6fe2701.使用django.db connections 经常报错mysq has gone away这个错误网上很多博客都有在讲,但是这里似乎是bug代码如下from django.db impor原创 2020-11-21 15:32:00 · 369 阅读 · 0 评论 -
Python中的thread
测试代码import threadingimport timedef do_thread_test(): print 'start thread time:', time.strftime('%H:%M:%S') time.sleep(5) print 'stop thread time:', time.strftime('%H:%M:%S')threads = []for i in range(2): thread1 = threading.Thread(原创 2020-08-27 22:29:56 · 206 阅读 · 0 评论