会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
咸鱼翻个身,还是咸鱼
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
下一页
2019年4月24日
python datetime操作
摘要: datetime object转化为timestamp 1 import datetime 2 now = datetime.datetime.now() 3 now_timestamp = time.mktime(now.timetuple()) timestamp 转化为 datetime ob
阅读全文
posted @ 2019-04-24 16:11 琵琶真的行
阅读(295)
评论(0)
推荐(0)
2019年4月19日
go的生产者-消费者模式
摘要: package main import ( "fmt" "math/rand" "time" ) // 数据生产者 func producer(header string, channel chan<- string) { // 无限循环, 不停地生产数据 for { // 将随机数和字符串格式化为
阅读全文
posted @ 2019-04-19 17:50 琵琶真的行
阅读(1097)
评论(0)
推荐(0)
2019年4月18日
golang语言示例
摘要: 生产者-消费者模式
阅读全文
posted @ 2019-04-18 16:13 琵琶真的行
阅读(626)
评论(0)
推荐(0)
2019年4月16日
数据库微信特殊表情编码django设置
摘要: #settings.py DATABASES = { 'default': { 'OPTIONS': { "init_command":"SET foreign_key_checks = 0;", #取消foreignkey的严格检查 "charset": "utf8mb4", #编码集修改,utf8mb4为utf8的扩展...
阅读全文
posted @ 2019-04-16 16:56 琵琶真的行
阅读(397)
评论(0)
推荐(0)
django 时区和系统(ubuntu)时区修改
摘要: django时区默认使用UTC,中国人使用CST东八区。 settings.py改为上海时区 系统时区保持一致:
阅读全文
posted @ 2019-04-16 15:29 琵琶真的行
阅读(429)
评论(0)
推荐(0)
django apscheduler在特定时间执行一次任务(run at a specify time only once)
摘要: 如何使程序在特定时间只执行一次,我查了一下。 celery可以,时间以秒计。 不过,我们存在以天、星期、甚至月的倒计时,感觉celery还是不满足需求。 最后找到了apscheduler。 from django.utils import timezone from apscheduler.sche
阅读全文
posted @ 2019-04-16 10:53 琵琶真的行
阅读(3306)
评论(0)
推荐(0)
2019年4月13日
假如生活欺骗了你
摘要: 假如生活欺骗了你不要悲伤 不要心急忧郁的日子里须要镇静相信吧 快乐的日子将会来临心儿永远向往着未来现在却常是忧郁一切都是瞬息一切都将会过去而那过去了的就会成为亲切的回忆
阅读全文
posted @ 2019-04-13 18:32 琵琶真的行
阅读(161)
评论(0)
推荐(0)
django csrf token添加
摘要: #views.py from django.shortcuts import render_to_response, RequestContext from django.views.decorators.csrf import csrf_protect @csrf_protect def index(request): if request.method == "GET...
阅读全文
posted @ 2019-04-13 18:30 琵琶真的行
阅读(659)
评论(0)
推荐(0)
django mongodb配置
摘要: #settings.py import os from mongoengine import * BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) DEBUG = False ALLOWED_HOSTS = ['*'] # Database # https://docs.djangoproject...
阅读全文
posted @ 2019-04-13 18:21 琵琶真的行
阅读(1879)
评论(0)
推荐(0)
django logging
摘要: LOG_LEVEL = 'DEBUG' LOGGING = { 'version' : 1, 'disable_existing_loggers' : True, 'formatters' : { 'standard' : { 'format' : '%(asctime)s [%(threadNam
阅读全文
posted @ 2019-04-13 18:20 琵琶真的行
阅读(222)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
下一页
公告