# -*- coding: utf-8 -*-
#
# (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com>
#
# See LICENSE comming with the source of 'trex' for details.
#
"""
Django settings for trex project.

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

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

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


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

# SECURITY WARNING: keep the secret key used in production secret!
with open(os.path.join(BASE_DIR, "secret.key"), "r") as secret:
        SECRET_KEY = secret.read()

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'trex',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'trex.urls'

WSGI_APPLICATION = 'trex.wsgi.application'

AUTH_USER_MODEL = "trex.User"


# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/

LANGUAGE_CODE = 'de-de'

TIME_ZONE = 'Europe/Berlin'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'

# Session handling
# As a minimum, session expires when the browser is closed.
# We expect this to be once a day for common users.
# If needed this can be enhanced by a time limit.
SESSION_EXPIRE_AT_BROWSER_CLOSE = True

# REST Framework settings
REST_FRAMEWORK = {
    # add django-filters backend
    'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.DjangoFilterBackend',)
}

@@ -2555,8 +2555,1055 @@
 nd',)%0A%7D%0A
+%0ALOGGING = %7B%0A    'version': 1,%0A    'disable_existing_loggers': True,%0A    'formatters': %7B%0A        'verbose': %7B%0A            'format': '%25(levelname)s %25(asctime)s %25(module)s %25(process)d '%0A                      '%25(thread)d %25(message)s'%0A        %7D,%0A        'simple': %7B%0A            'format': '%25(levelname)s %25(asctime)s %25(module)s %25(message)s'%0A        %7D,%0A    %7D,%0A    'filters': %7B%0A        'require_debug_false': %7B%0A            '()': 'django.utils.log.RequireDebugFalse'%0A        %7D,%0A    %7D,%0A    'handlers': %7B%0A        'null': %7B%0A            'level': 'DEBUG',%0A            'class': 'django.utils.log.NullHandler',%0A        %7D,%0A        'mail_admins': %7B%0A            'level': 'ERROR',%0A            'filters': %5B'require_debug_false'%5D,%0A            'class': 'django.utils.log.AdminEmailHandler'%0A        %7D,%0A        'console': %7B%0A            'level': 'DEBUG',%0A            'class': 'logging.StreamHandler',%0A            'formatter': 'simple',%0A        %7D,%0A    %7D,%0A    'loggers': %7B%0A        'django': %7B%0A            'handlers': %5B'null'%5D,%0A            'level': 'INFO',%0A        %7D,%0A    %7D%0A%7D%0A

Set default logging in settings