# coding=utf-8 from base import * # redis配置 CACHES = { 'default': { 'BACKEND': 'django_redis.cache.RedisCache', 'LOCATION': 'redis://127.0.0.1:6379/0', "OPTIONS": { "CLIENT_CLASS": "django_redis.client.default.DefaultClient", }, }, } DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'gzyun', 'USER': 'root', 'PASSWORD': 'xjc890*()', 'HOST': '127.0.0.1', 'PORT': '3306', } } # 短信配置 common.sms.py使用 SMS_ACCOUNT_SID = "8a216da8588b296f01588ecd0a0001ab" SMS_AUTH_TOKEN = "f0d2b53782374ebc8a76fa8dd06bb4d2" SMS_APP_ID = "8a216da8589ae4840158a89b5c8f0272" SMS_URL = "https://app.cloopen.com:8883/2013-12-26/Accounts/%s/SMS/TemplateSMS" % SMS_ACCOUNT_SID SMS_LOG_PATH = os.path.join(BASE_DIR, "../logs", "sms") SEND_SMS = False # 验证码字体库位置 FONT_PATH = os.path.join(BASE_DIR, "../static/font", "consola.ttf") AUTHENTICATION_BACKENDS = [ "account.cauth.AccountManage", ] # session 过期设置 SESSION_COOKIE_AGE = 60 * 30 SESSION_SAVE_EVERY_REQUEST = True SESSION_COOKIE_HTTPONLY = False LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'standard': { 'format': '%(asctime)s [%(name)s:%(lineno)d] [%(module)s:%(funcName)s] [%(levelname)s]- %(message)s' } }, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'level': 'INFO', 'formatter': 'standard' }, }, 'loggers': { '': { 'handlers': ['console'], 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'), } }, } #channels CHANNEL_LAYERS = { "default": { "BACKEND": "asgi_redis.RedisChannelLayer", "CONFIG": { "hosts": [os.environ.get('REDIS_URL', 'redis://localhost:6379')], }, "ROUTING": "dashboard.routings.channel_routing", }, }