# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from .base_settings import *
from .celery_task_settings import *
import pymysql
pymysql.install_as_MySQLdb()

SECRET_KEY = '79!ro64h@pcse-1z=$v&_sh)+d))9rifii79of0gb8uyb86=8m'

DEBUG = False

ALLOWED_HOSTS = ['*']

STATIC_ROOT = '/srv/static/mars'

RAVEN_CONFIG = {
    'dsn': 'http://9f8992868f0348efaca2f4375e8db1df:11764cbbdb1440c38142c9e1a1e663ac@sentry.igengmei.com/131',
}
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {  # mysql
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mars_test',
        'USER': 'work',
        'PASSWORD': 'Gengmei1',
        'HOST': 'local-mysql',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET foreign_key_checks = 0;",
            "charset": "utf8mb4",
        },
    },
    'gaia': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'zhengxing_test',
        'USER': 'work',
        'PASSWORD': 'Gengmei1',
        'HOST': 'local-mysql',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET foreign_key_checks = 0;",
            "charset": "utf8mb4",
        },
    },
    'mars-master': {  # mysql
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mars_test',
        'USER': 'work',
        'PASSWORD': 'Gengmei1',
        'HOST': 'local-mysql',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET foreign_key_checks = 0;",
            "charset": "utf8mb4",
        },
    },
   'gaia-master': {  # mysql
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'zhengxing_test',
        'USER': 'work',
        'PASSWORD': 'Gengmei1',
        'HOST': 'local-mysql',
        'PORT': '3306',
        'OPTIONS': {
          "init_command": "SET foreign_key_checks = 0;",
          "charset": "utf8mb4",
        },
    },
    'zeus': {
        'ENGINE': 'django.db.backends.mysql',  # 设置为mysql数据库
        'NAME': 'zeus_test',
        'USER': 'work',
        'PASSWORD': 'Gengmei1',
        'HOST': 'local-mysql',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET foreign_key_checks = 0;",
            "charset": "utf8mb4",  # 为了支持emoji表情
        },
    },
}
DATABASE_ROUTERS = ["tool.routers.GaiaRouter"]

RPC_URL = 'http://10.25.194.175/api/'
RPC_KEY = 'basic:6o9sVEB6+H5U61rfZpVMioWcRRoU32uazNE3h18kwcAqOMPVdjmvQ72XxZVNLNl6RSACrgLeD7xrKYsxL1iZ6A=='

BACKEND = 'http://wanmeizhensuo.com'

USER_COOKIE_NAME = 'session_key'
USER_COOKIE_TIME = 864000 # 10 days

BROKER_URL = 'redis://192.168.168.142:6379/13'


# ===========================================
ES_HOSTS = [{
    'host': '192.168.168.142',
    'port': 9200,
}, {
    'host': '192.168.168.142',
    'port': 9200,
}, {
    'host': '192.168.168.142',
    'port': 9200,
}]
# ===========================================

# ===========================================
EMAIL_HOST = 'smtp.exmail.qq.com'
EMAIL_HOST_USER = 'doctor@wanmeizhensuo.com'
EMAIL_HOST_PASSWORD = 'gengmei098'
STATIS_EMAIL_USER = 'youjiantongji@wanmeizhensuo.com'
STATIS_EMAIL_PSWD = 'mq37tgk8nGi6eg1Hgq388oro3itvdmPl'
DEFAULT_FROM_EMAIL = 'doctor@wanmeizhensuo.com'
BrokenLinkEmailsMiddleware = True
SERVER_EMAIL = 'doctor@wanmeizhensuo.com'
EMAIL_PORT = 25
# ===========================================

# ===================================
# 邮件统计收件人
WATCHER = ['wangchengliang@gmei.com', 'linhuazhu@mei.com']  # 数据组自己统计

QUDAOZU = ['qudaozutongji@wanmeizhensuo.com']                    # 今日分渠道设备,用户统计
CITY_SERVICE = ['skutongji@wanmeizhensuo.com']                   # 今日各城市在售美购统计
SIXINZU = ['sixintongji@wanmeizhensuo.com']                      # 本周医生未回复私信统计
DOCTOR_WATCHER = ['hexinyishengtongji@wanmeizhensuo.com']        # 今日医生美购浏览量统计

JIAOYIZU = ['jiaoyizutongji@wanmeizhensuo.com']  # 今日交易组统计邮件
SHEQUZU = ['shequzutongji@wanmeizhensuo.com']    # 今日社区组统计邮件
QUDAOZU2 = ['qudaozutongji@wanmeizhensuo.com']   # 今日渠道组活跃统计邮件
YONGHUZU = ['yonghutongji@wanmeizhensuo.com']    # 今日日记本缺失美购统计

DINGDAN = ['dingdantongji@wanmeizhensuo.com']  # 美购退款统计
YUYUE = ['yuyuetongji@wanmeizhensuo.com']      # 美购预约统计
AISI = ['qudaozutongji_common_aisi@wanmeizhensuo.com'] # 爱思助手推广
WATCHER_TWO = [
    'wangchengliang@gmei.com',
    'zhuyaoyao@gmei.com',
    'dengwenyue@gmei.com',
    'linhuazhu@gmei.com'
]
###2016-08-10###
BIHUAN = ['bh@gmei.com']
###end####
# ===================================

# ===========================================
ZHIDA_SK = 'vOom6KmcFBSVnWOy22qPmX7IGMpdsBUv'
ZHIDA_URL = 'http://m.baidu.com/lightapp/pay/order/offline/add'
ZHIDA_SP_NO = 93836
# ===========================================

CACHE = {
'default':
    { 'BACKEND': 'redis_cache.cache.RedisCache',
      'LOCATION': 'redis://192.168.168.142:6379/15',
      'TIMEOUT': 86400,
    },
}
### 2016-05-30 Add by LinHuaZhu
AUTHORIZATION_ID = 'gmauth_key'
AUTHORIZATION_KEY = 'ecaeb940a2c615f654265183b3f8e76f'
###end####

###2016-06-02 Add by LinHuaZhu
SENTRY_CELERY_ENDPOINT = 'http://f549010eff314c97abd1c345796be3dc:accf8f78f693405fba4de405457111e9@sentry.gengmei.cc/33'
###end####

###2016-08-04 Add by WangChengYang
AES_KEY = '7vgc5dIbnkV5FM4C'
AES_IV = 'W2juIMi4urH9SiL0'
###end####
