
import helios

from .log_settings import LOG_DIR

SENTRY_CELERY_ENDPOINT = 'http://45b0ef6a79204d6988b59c32c9dd4bef:fa018677fb4f49be88d2ba61cdc7ee32@sentry.igengmei.com/135'
USER_COOKIE_NAME = 'sessionid'
SESSION_COOKIE_AGE = 60 * 60 * 24 * 600  # Age of cookie, in seconds (default: 300 weeks).
SESSION_COOKIE_PATH = '/'
SESSION_COOKIE_SECURE = False
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_DOMAIN_IGENGMEI = '.alpha.env'

START_NUM_UPLIMIT = 1200

def GM_LOGGING():
    from engine.logger import RequestInfoExtractor
    return {
        'request_info_extractor_class': RequestInfoExtractor,
        'log': {
            'basedir': LOG_DIR,
            'prefix': 'saturn',
            'buffered': not DEBUG,
        }
    }

GMTRACER_PARSER = 'engine.setup_tracer'

DEBUG = False

RPC_INVOKER = helios.rpc.create_default_invoker(debug=DEBUG)

TRACKING_COOKIE_NAME = '_gtid'
TRACKING_COOKIE_AGE = 365 * 24 * 60 * 60

API_HOST = "http://backend.alpha.env"
WEB_API_HOST = "http://m.alpha.env"

# wechat_pub
WECHATPUB_APPID = 'wx007f571568e5186e'
WECHATPUB_APPSECRET = 'c241098e95f3a0b3e654d5ca5b370db0'

QQ_MAP_KEYS = [
    'QVMBZ-KZFRJ-VQ5F6-FMJIJ-SCJN6-WNFFS',
    '2RJBZ-EWTW3-ANB3A-3O6KS-SDYRK-EQFFO',
    '2LZBZ-K353F-ZQKJG-JGT7Z-PQYD2-YVBLE',
    'D7FBZ-SRGKG-AU3QI-IGMXR-63EU3-3PBOA',
    'H52BZ-JH2WX-EAB4T-TXW23-SNBLQ-GNFNQ',
    'RL2BZ-CASW3-MJ53C-3JCUR-IEGRO-TABLU',
    'NJIBZ-L2H3U-ZWLV6-4W3PK-H7DFF-OSFUM',
    'ZOBBZ-FP2WX-CA74G-TZC24-MPSL7-22BD4',
    'TENBZ-AZ53P-JRTDP-LUIQ2-KNVE6-XNF4X',
    'L7GBZ-JKMWP-HKJDV-LQPEC-QQ2M7-D6BAT',
    'PFPBZ-63ZRR-AB2W7-WHADL-LSDEH-CNFRN',
    '2EEBZ-6RYWD-EF546-H7Z5U-HKFLT-JWB2L',
    'KXHBZ-3HZ3O-OSIWQ-SVMHT-DMLBE-J6FJD',
    'CUNBZ-QAL3X-BPX4M-7BL77-YG5TZ-SCBPI',
    'QM5BZ-Z2RRX-ZZR4M-ZGBYO-X5BH5-X2BK2',
]

QINIU_ACCESS_KEY = "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL"
QINIU_SECRET_KEY = "z5YvpDDSam_JE345Z8J_f3TufzelOW2VOGNoBl9e"
GM_UPLOAD_ENV = "alpha"

QINIU_WATERMARK_BUCKET = 'alpha'
QINIU_FACE_BUCKET = 'alpha-s'

FACE_TOP_N_CNT = 3

REDIS_GROUP = {
    'desc_cache': {'host': '127.0.0.1', 'port': 6379, 'db': 1},
    'qq_cache': {'host': '127.0.0.1', 'port': 6379, 'db': 1},
}

OPERTATION_POSITION = 3  # 运营卡片位置
PORTRAIT_POSITION = 0  # 拟合头像卡片位置

CELERY_TIMEZONE = 'Asia/Shanghai'
CELERY_TASK_SERIALIZER = "json"
BROKER_URL = 'redis://127.0.0.1:6379/5'
FACE_SHARE_URL = 'http://earth.iyanzhi.com/alpha/fitting/'
FACE_SHARE_DESCRIPTION = '在颜值打卡APP，这里的颜值很不错！'
FACE_IMG_URL = 'http://alpha-s.iyanzhi.com/'

IMAGE_SUFFIX = '-aspectscale'  # 瀑布流图片后缀
