import os

BASE_DIR = os.path.dirname(
    os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

ROOT_URLCONF = "urls"

WSGI_APPLICATION = "etc.wsgi.wsgi"

SECRET_KEY = '=y-!a%%@j@u7@4dx%1xii$+rrqory&%nnpo&ciyw_d_g^qmf39'

ALLOWED_HOSTS = ['*']

DEBUG = os.environ.get("DJANGO_DEBUG", True)

LANGUAGE_CODE = 'en-us'

TIME_ZONE = "Asia/Shanghai"

USE_I18N = True

USE_L10N = True

USE_TZ = False

LOG_PATH = os.path.join(os.path.dirname(BASE_DIR), "logs")
if not os.path.exists(LOG_PATH):
    os.makedirs(LOG_PATH)
DEFAULT_HANDLERS = ['file_handler', 'console']

OPEN_SILK = os.environ.get("OPEN_SILK", False)
SILKY_PYTHON_PROFILER_RESULT_PATH = os.path.join(LOG_PATH, "silky_logs")
SILKY_PYTHON_PROFILER = True
SILKY_PYTHON_PROFILER_BINARY = True
if not os.path.exists(SILKY_PYTHON_PROFILER_RESULT_PATH):
    os.makedirs(SILKY_PYTHON_PROFILER_RESULT_PATH)

NAME_ID_LENGTH = 6
VERSION = 'v1'

