This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding=utf-8 -*- | |
# Created Time: Wed 07 Jan 2015 03:51:26 PM CST | |
# File Name: pinpin.py | |
# Author: bwhite.liiiii@gmail.com | |
''' | |
测试 汉语拼音转换工具 pypinyin 库的使用. | |
将汉语转为拼音。可以用于汉字注音、排序、检索。 | |
根据词组智能匹配最正确的拼音。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:huahua] | |
command = /home/apps/hua_env/start | |
user = web | |
stdout_logfile = /home/apps/hua_env/logs/super.log | |
redirect_stderr = true | |
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding=utf-8 -*- | |
DEBUG = True | |
TEMPLATE_DEBUG = DEBUG | |
ADMINS = ( | |
('bwhite','bwhite.liiiii@gmail.com'), | |
) | |
DATABASES = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream hua_server { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response(in case the Unicorn master nukes a | |
# single worker for time out). | |
# server 127.0.0.1:8085; | |
ip_hash; | |
server unix:/home/apps/hua_env/run/gunicorn.sock fail_timeout=0; | |
} | |
server { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NAME="huahua" | |
DJANGODIR=/home/apps/hua_env/huahua | |
SOCKFILE=/home/apps/hua_env/run/gunicorn.sock | |
USER=web | |
GROUP=webgrp | |
NUM_WORKERS=1 | |
DJANGO_SETTINGS_MODULE=hua.settings.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding=utf-8 -*- | |
# Created Time: Fri 21 Nov 2014 10:18:31 AM CST | |
# File Name: dateutil.py | |
# Author: bwhite.liiiii@gmail.com | |
''' | |
计算两个时间之间的差, 可以是s, min, hour, day, month, year. | |
所以这个上方库非常方便 | |
关于rrule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding=utf-8 -*- | |
# Created Time: Fri 02 Jan 2015 03:28:17 PM CST | |
# File Name: producer_consumer.py | |
# Author: bwhite.liiiii@gmail.com | |
''' | |
生产者 消费者 python | |
随机数, 文件锁, json, 中文, 异常, 队列, 线程 | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding=utf-8 -*- | |
# Created Time: Mon 05 Jan 2015 04:11:10 PM CST | |
# File Name: diff_datetime.py | |
# Author: bwhite.liiiii@gmail.com | |
''' | |
根据一个日期生成相隔多少天,月,年的另一个日期 | |
''' | |
import datetime |