# -*- coding: utf-8 -*-
"""
Django settings for ntelProject project.

Generated by 'django-admin startproject' using Django 1.11.1.

For more information on this file, see
https://docs.djangoproject.common/en/1.10/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.common/en/1.10/ref/settings/
"""

import os


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.common/en/1.10/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'miozo6krang3o%$&%-ts6t5*3+e69eekm+ll!k#qdn4$$k152i'

# SECURITY WARNING: don't run with debug turned on in production!
# 디버그 모드 설정
DEBUG = True

ALLOWED_HOSTS = []


# Application definition
# pip로 설치한 앱 또는 자신이 만든 app을 추가
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Added Apps
    'common.apps.CommonConfig',
    'main.apps.MainConfig',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'ntelProject.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates'),],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

DATETIME_INPUT_FORMATS = [
    '%Y-%m-%d %H:%M:%S',     # '2006-10-25 14:30:59'
    '%Y-%m-%d %H:%M:%S.%f',  # '2006-10-25 14:30:59.000200'
    '%Y-%m-%d %H:%M',        # '2006-10-25 14:30'
    '%Y-%m-%d',              # '2006-10-25'
    '%Y/%m/%d %H:%M:%S',     # '2006/10/25 14:30:59'
    '%Y/%m/%d %H:%M:%S.%f',  # '2006/10/25 14:30:59.000200'
    '%Y/%m/%d %H:%M',        # '2006/10/25 14:30'
    '%Y/%m/%d',              # '2006/10/25'
    '%y/%m/%d %H:%M:%S',     # '06/10/25 14:30:59'
    '%y/%m/%d %H:%M:%S.%f',  # '06/10/25 14:30:59.000200'
    '%y/%m/%d %H:%M',        # '06/10/25 14:30'
    '%y/%m/%d',              # '06/10/25'    
]


WSGI_APPLICATION = 'ntelProject.wsgi.application'


# Database
# https://docs.djangoproject.common/en/1.10/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',    
        'NAME': 'ntel',
        'USER': 'ntel',
        'PASSWORD': '007kkt',
        'HOST': '127.0.0.1',
        'PORT': '3307'
    },         
    'nteldb' :  {
        'ENGINE': 'django.db.backends.mysql',    
        'NAME': 'test',
        'USER': 'test',
        'PASSWORD': '007kkt',
        'HOST': '127.0.0.1',
        'PORT': '3307'
    }
}


# Password validation
# https://docs.djangoproject.common/en/1.10/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.common/en/1.10/topics/i18n/

#LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'ko-kr'

#TIME_ZONE = 'UTC'
TIME_ZONE = 'Asia/Seoul'

USE_I18N = True

USE_L10N = True

USE_TZ = True


PROJECT_DIR=os.path.dirname(__file__)
print("PROJECT_DIR : " + PROJECT_DIR)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.common/en/1.10/howto/static-files/
# 정적 파일 의 URL
STATIC_URL = '/static/'

STATIC_ROOT= os.path.join(PROJECT_DIR,'static/')

STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ]
