"""
Django settings for irra project.

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

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

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/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.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 't_ideh851d66w5cl7r0obe#tgcq6x^c0*-ut8svyf4(xngte&o'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'djangobower',
    'bootstrap3',
    'django_filters',
    'irra.apps.main',
    'irra.apps.dataset',
]

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 = 'irra.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(BASE_DIR, 'irra', 'templates'),
            os.path.join(BASE_DIR, 'apps', 'dataset', 'templates'),
            os.path.join(BASE_DIR, 'apps', 'main', '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',
            ],
        },
    },
]

WSGI_APPLICATION = 'irra.wsgi.application'


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

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


# Password validation
# https://docs.djangoproject.com/en/1.11/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.com/en/1.11/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


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

STATIC_URL = '/static/'

# custom configs

PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')


SUN09 = 'data/sun09_groundTruth.mat'
QUERY_TRAIN = 'data/Struct-Query-Train.mat'
QUERY_TEST = 'data/Struct-Query-Test.mat'
SEGMENTATION = 'data/segmented'

IMAGE_SHAPE = (384, 384)

STATICFILES_DIRS = [
    'data/images/',
    'data/bower_components'
]

PALETTE = [\
[ 0, 0, 0],
[128, 0, 0],
[ 0, 128, 0],
[128, 128, 0],
[ 0, 0, 128],
[128, 0, 128],
[ 0, 128, 128],
[128, 128, 128],
[64, 0, 0],
[192, 0, 0],
[64, 128, 0],
[192, 128, 0],
[64, 0, 128],
[192, 0, 128],
[64, 128, 128],
[192, 128, 128],
[ 0,64, 0],
[128,64, 0],
[ 0, 192, 0],
[128, 192, 0],
[ 0,64, 128],
[128,64, 128],
[ 0, 192, 128],
[128, 192, 128],
[64,64, 0],
[192,64, 0],
[64, 192, 0],
[192, 192, 0],
[64,64, 128],
[192,64, 128],
[64, 192, 128],
[192, 192, 128],
[ 0, 0,64],
[128, 0,64],
[ 0, 128,64],
[128, 128,64],
[ 0, 0, 192],
[128, 0, 192],
[ 0, 128, 192],
[128, 128, 192],
[64, 0,64],
[192, 0,64],
[64, 128,64],
[192, 128,64],
[64, 0, 192],
[192, 0, 192],
[64, 128, 192],
[192, 128, 192],
[ 0,64,64],
[128,64,64],
[ 0, 192,64],
[128, 192,64],
[ 0,64, 192],
[128,64, 192],
[ 0, 192, 192],
[128, 192, 192],
[64,64,64],
[192,64,64],
[64, 192,64],
[192, 192,64],
[64,64, 192],
[192,64, 192],
[64, 192, 192],
[192, 192, 192],
[32, 0, 0],
[160, 0, 0],
[32, 128, 0],
[160, 128, 0],
[32, 0, 128],
[160, 0, 128],
[32, 128, 128],
[160, 128, 128],
[96, 0, 0],
[224, 0, 0],
[96, 128, 0],
[224,  128, 0],
[96, 0, 128],
[224, 0, 128],
[96, 128, 128],
[224, 128, 128],
[32,64, 0],
[160,64, 0],
[32, 192, 0],
[160, 192, 0],
[32,64, 128],
[160,64, 128],
[32, 192, 128],
[160, 192, 128],
[96,64, 0],
[224,64, 0],
[96,  192, 0],
[224,  192, 0],
[96,64, 128],
[224,64, 128],
[96, 192, 128],
[224, 192, 128],
[32, 0,64],
[160, 0,64],
[32, 128,64],
[160, 128,64],
[32, 0, 192],
[160, 0, 192],
[32,  128, 192],
[160, 128, 192],
[96, 0,64],
[224, 0, 64],
[96, 128, 64],
[224, 128, 64],
[96, 0, 192],
[224, 0, 192],
[96, 128, 192],
[224, 128, 192]]

ALIASES = {'bars': 'bar',
           'bottles': 'bottle',
           'boxes': 'box',
           'cars': 'car',
           'flowers': 'flower',
           'rocks': 'rock',
           'stone': 'rock',
           'stones': 'rock'}