# coding:utf-8
'''
设置
Author : qbeenslee
Created : 2014/10/9
'''
import os

# 是否开启测试
DEBUG = False

BASE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))


# 数据库设置


# if DEBUG:
# DB_CONFIG = {
# "host": '127.0.0.1',
# "db": 'nepenthes',
# "port": '3140',
# "user": 'test',
# "password": 'abcd',
# }
# else:
# import sae.const
#
# DB_CONFIG = {
# "host": sae.const.MYSQL_HOST,
# "db": sae.const.MYSQL_DB,
# "port": sae.const.MYSQL_PORT,
# "user": sae.const.MYSQL_USER,
# "password": sae.const.MYSQL_PASS,
# }

DB_CONFIG = {
    "host": '127.0.0.1',
    "db": 'nepenthes',
    "port": '3306',
    "user": 'test',
    "password": 'abcdef',
}

# 数据库连接
DB_CONNECT_STRING = 'mysql://' + DB_CONFIG['user'] + ':' + DB_CONFIG['password'] + '@' + DB_CONFIG['host'] + ':' + \
                    DB_CONFIG['port'] + '/' + DB_CONFIG['db'] + '?charset=utf8'

settings = {
    'cookie_secret': 'WJyZi+hkyLTMS0X3yVHn6SzaFrY0jscNRCN6aXBIUaTCZhC',
    'debug': DEBUG,
    'static_path': os.path.join(BASE_PATH, 'static'),
}


# 密码重试次数
PWD_ERROR_TIME = 10

# 密码有效时长(单位:s 时长:7天)
PWD_HOLD_TIME_DEFAULT = 604800.0

PWD_HOLD_TIME_SHORT = 36000.0

# 密码迭代次数区间
PWD_ITERATION_INTERVAL = {'MIN': 11, 'MAX': 99}

# 发信邮箱账号
OFFICE_EMAIL_COUNT = r'****'
OFFICE_EMAIL_SMTPSERVER = r'****'
OFFICE_EMAIL_NAME_TITLE = r'****'
OFFICE_EMAIL_PASSWORD = r'****'

UPLOAD_PATH = os.path.join(BASE_PATH, 'static/upload/')

if __name__ == '__main__':
    print BASE_PATH
    print UPLOAD_PATH
