import os
import os.path
import logging
from django.conf import settings


# EMAIL_HOST='smtp.gmail.com'
# EMAIL_HOST_USER = 'wujingwen1112@gmail.com'
# EMAIL_HOST_PASSWORD='jingwen1112'
# EMAIL_PORT='587'
# EMAIL_USE_TLS = True
#DEFAULT_FROM_EMAIL = "admin@domain.com"
#SERVER_EMAIL = "admin@domain.com"

INSTALLED_APPS = (
    'jogging',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'registration',
    'tagging',
    'ldt',
    'ldt.core',
    'ldt.ldt_utils',
    'ldt.user',
    'ldt.management',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'jogging.middleware.LoggingMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = ( 
    "django.core.context_processors.request",
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "ldt.utils.context_processors.ldt",
    "ldt.utils.context_processors.base",
    "ldt.utils.context_processors.web",
    "ldt.utils.context_processors.version",
)



WEB_URL = getattr(settings, 'WEB_URL', '')
BASE_URL = getattr(settings, 'BASE_URL', '')
MEDIA_URL = getattr(settings, 'MEDIA_URL', '')
MEDIA_ROOT = getattr(settings, 'MEDIA_ROOT', '')
SITE_ID = getattr(settings, 'SITE_ID', 1)
DEBUG = getattr(settings, 'DEBUG', False)
MANAGERS = settings.MANAGERS
INSTALLED_APPS = settings.INSTALLED_APPS
LANGUAGES = settings.LANGUAGES
DECOUPAGE_BLACKLIST =getattr(settings, 'DECOUPAGE_BLACKLIST', 'de_PPP')
STREAM_URL = getattr(settings, 'STREAM_URL', '')
STREAM_PATH = getattr(settings, 'STREAM_PATH', '')
STREAM_SRC_PREFIX = getattr(settings, 'STREAM_SRC_PREFIX', '')
LOG_FILE = getattr(settings, 'LOG_FILE', '')
LOG_LEVEL = getattr(settings, 'LOG_LEVEL', logging.INFO)
EMPTY_MEDIA_EXTERNALID = getattr(settings, 'EMPTY_MEDIA_EXTERNALID', None)

GLOBAL_LOG_LEVEL = LOG_LEVEL
GLOBAL_LOG_HANDLERS = [logging.FileHandler(LOG_FILE)]


ACCOUNT_ACTIVATION_DAYS =  getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', 7)
LDT_MEDIA_PREFIX =  getattr(settings, 'LDT_MEDIA_PREFIX', MEDIA_URL + 'ldt/')
LDT_MAX_SEARCH_NUMBER = 50
LDT_JSON_DEFAULT_INDENT = 2



