This file contains 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
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'formatters': { | |
'verbose': { | |
'format': | |
"""level: %(levelname)s | |
time: %(asctime)s | |
module : %(module)s | |
function:%(funcName)s |
This file contains 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
def deco_set_max_field_width(tmpl=""): | |
def render(func): | |
def wrapper(req, *args, **kwargs): | |
output = func(req, *args, **kwargs) | |
if not isinstance(output, dict): | |
return output | |
tpl = tmpl | |
if output and output.has_key("tpl"): | |
tpl = output["tpl"] | |
fields_cn = output["fields_cn"] |
This file contains 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 with PyCharm. | |
# Author: liyinhui | |
# Date: 13-5-31 | |
# Time: 下午1:49 | |
# 基于PyCrypto库实现 | |
import base64 | |
from Crypto.Cipher import AES | |
iv = "fedcba9876543210" |
This file contains 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 with PyCharm. | |
# Author: liyinhui | |
# Date: 13-5-31 | |
# Time: 下午8:19 | |
# 基于m2crypto库 | |
import base64 | |
from M2Crypto import EVP | |
This file contains 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
jQuery.extend(jQuery.validator.messages, { | |
required:"请输入此项", | |
remote:"请修正该字段", | |
email:"请输入正确格式的电子邮件", | |
url:"请输入合法的网址", | |
date:"请输入合法的日期", | |
dateISO:"请输入合法的日期 (ISO).", | |
number:"请输入合法的数字", | |
digits:"只能输入整数", | |
creditcard:"请输入合法的信用卡号", |
This file contains 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
createAccountFormValid.validate({ | |
errorElement:"span", | |
rules:{ | |
username:{ | |
required:true, | |
digits:true, | |
minlength:5, | |
maxlength:20, | |
remote:{ | |
url:"/account/exists/", |
This file contains 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 with PyCharm. | |
# Author: liyinhui | |
# Date: 13-7-3 | |
# Time: 上午10:33 | |
# | |
from _mysql import IntegrityError | |
import logging | |
import traceback | |
import MySQLdb |
This file contains 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
def api(request, cate_pinyin, title): | |
response = {"success": False, "msg": "", "code": "", "result": {}} | |
article_class = ARTICLE_CLASS_MAPPING.get(cate_pinyin, None) | |
if not article_class: | |
response["code"] = 404 | |
response["msg"] = CATEGORY_DOES_NOT_EXIST["error"] | |
else: | |
title = urllib.unquote(title) | |
if cate_pinyin == "renwu": | |
articles = article_class.objects.filter(name=title) |
This file contains 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 | |
""" | |
百科ES搜索引擎初始化模块 | |
""" | |
import datetime | |
import pyes | |
import pymssql | |
__author__ = 'lyhapple' |
This file contains 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 | |
""" | |
百科ES搜索引擎初始化模块 | |
""" | |
from Queue import Queue | |
import datetime | |
import time | |
import threading | |
import traceback | |
import pyes |
OlderNewer