from .base_settings import *

STATIC_ROOT = '/srv/static/ascle/'
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

DEBUG = True
CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': 'redis://local-redis-ha:6379/6',
        'KEY_PREFIX': 'ascle',
        'TIMEOUT': 86400,  # one day
    },
}
REDIS = {'host': 'local-redis-ha', 'port': 6379, 'db': 6}
BROKER_URL = 'redis://local-redis-ha:6379/8'

QINIU_ACCESS_KEY = "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL"
QINIU_SECRET_KEY = "z5YvpDDSam_JE345Z8J_f3TufzelOW2VOGNoBl9e"

CACHE_PAGE_STATUS = False   # 页面缓存的开关

STATEMENT_VISIBLE = True  # 对账单显示开关
MAIDAN_VISIBLE = True  # 买单开关

# 总开关, True则全部人能看见
DOCTOR_CAN_SEE_TRAFFIC = True
# 白名单, use Doctor.id, 只要配置了一定能看见
DOCTOR_TRAFFIC_WHITE_LIST = [
    'wangyang', 'aojianfei', 'chenxiaofang',
]

# 前后端分离了，添加fe 中的index.html 和 static
# ====!!!!!!dev/test/release无须配置, remove three lines settings !!!!!!!!
from .base_settings import TEMPLATES, STATICFILES_DIRS, BASE_DIR
TEMPLATES[0]['DIRS'].append(os.path.join(BASE_DIR, 'fe', 'dist'))
STATICFILES_DIRS.append(os.path.join(BASE_DIR, 'fe', 'dist', 'static'))
