"""
Django settings for djangoproton project.

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

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

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

import os

"""
+----------------------------------------
| Proton Settings
+----------------------------------------
| In addition to all the standard settings, Proton adds a bunch of 
| extra settings to keep everything in good working order. 
| Do not remove these next few Proton-specific lines!
"""

from proton.settings import *
from proton.settings.base import * # PROTON_INSTALLED_APPS, PROTON_MIDDLEWARE, PROJECT_PATH

"""
+----------------------------------------
| End of Proton specific setting imports
+----------------------------------------
|
"""




# 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/2.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '#%v!)-&6u@&v^3m6o7pmma)^-(vjs90!=9@f)kvaiz9b0m9rm&'

# 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',
]

"""
+----------------------------------------
| Proton Installed Apps
+----------------------------------------
| Here we tag on the apps that Proton has added
| This may need to be changed from an 'extend' to more of a direct import as the order of the apps may be important
| Perhaps loop over the Proton Installed apps, and insert them each at position 5 (after the defaults)
|
"""

INSTALLED_APPS.extend(PROTON_INSTALLED_APPS)


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

TEMPLATES = [
  {
      'BACKEND': 'django.template.backends.django.DjangoTemplates',
      'DIRS': [
          os.path.join(BASE_DIR, 'proton/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 = 'djangoproton.wsgi.application'



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

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True




"""
+----------------------------------------
| Sass Settings
+----------------------------------------
| This section outlines the settings for the
| django-sass-processor
|
"""

SASS_PROCESSOR_ROOT = [ os.path.join(BASE_DIR, 'proton/bootstrap/dist/css') ]
SASS_PROCESSOR_INCLUDE_FILE_PATTERN = r'^.+\.scss$'
SASS_OUTPUT_STYLE = 'compact'
SASS_PRECISION = 8

SASS_PROCESSOR_INCLUDE_DIRS = [
  os.path.join(BASE_DIR, 'proton/bootstrap/scss'),
]



# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.0/howto/static-files/
"""
+----------------------------------------
| Static Files
+----------------------------------------
| Telling Django to also look in our Proton
| folder for static files --> /bootstrap
|
"""

STATICFILES_FINDERS = [
  'django.contrib.staticfiles.finders.FileSystemFinder',
  'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
STATICFILES_DIRS = [
  os.path.join(BASE_DIR, "proton/bootstrap/"),
  os.path.join(BASE_DIR, "djangoproton/static/"),
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
