1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import logging
- import os
- env = os.getenv("ANS_ENV")
- if not env:
- raise Exception("get ANS_ENV failed, set it IN CAUTION!!!")
- elif env == "online":
- from .online import *
- elif env == "test":
- from .test import *
- elif env == "dev":
- from .dev import *
- else:
- raise Exception("ANS_ENV not in (online, test, dev)")
- # REDIS_CONF = {
- # "host": REDIS_HOST,
- # "port": 6379,
- # "password": REDIS_PASSWORD,
- # "decode_responses": False,
- # "retry_on_timeout": True,
- # "max_connections": 50,
- # "db": 0
- # }
- MYSQL_AUTH_CONF = dict(user="admin",
- password="NSYbBSPbkGQUbOSNOeyy",
- host="retail-data.cnrgrbcygoap.us-east-1.rds.amazonaws.com",
- database="ansjer_dvadmin",
- port=3306)
- MYSQL_DATA_CONF = dict(user=MYSQL_DATA_USER,
- password=MASQL_DATA_PASSWORD,
- host=MASQL_DATA_HOST,
- database="asj_ads",
- port=3306)
- AWS_LWA_CLIENT = {
- 'lwa_client_id': 'amzn1.application-oa2-client.ebd701cd07854fb38c37ee49ec4ba109',
- 'lwa_client_secret': 'cbf0514186db4df91e04a8905f0a91b605eae4201254ced879d8bb90df4b474d',
- }
- LOG_CONF = {
- "version": 1,
- "disable_existing_loggers": True,
- "formatters": {
- "normal": {
- "class": "logging.Formatter",
- "format": "%(asctime)s [%(name)s] %(levelname)s: %(message)s"
- }
- },
- "handlers": {
- "console": {
- "level": LOG_LEVEL,
- "class": "logging.StreamHandler",
- "formatter": "normal"
- },
- "email": {
- 'level': 'WARNING',
- 'class': 'logging.handlers.SMTPHandler',
- 'mailhost': ('email-smtp.us-east-1.amazonaws.com', 587),
- 'fromaddr': 'datalab@ansjer.com',
- 'toaddrs': [
- '1067279008@qq.com',
- ],
- 'subject': 'sync_amz_data',
- 'credentials': ('AKIARBAGHTGOTVILWLB7', 'BEVt2GkzivI0xhnLWgwJCT2k7lDSg8HW+APD3mc4uHVg'),
- 'secure': {}
- }
- },
- "loggers": {
- "": {
- "handlers": LOG_HANDLERS,
- "level": "DEBUG",
- },
- "sync_amz_ad": {
- "handlers": LOG_HANDLERS,
- "level": LOG_LEVEL,
- 'propagate': False,
- },
- "botocore": {
- "level": logging.ERROR,
- 'propagate': False,
- }
- }
- }
|