"""
Django settings for gsa project.

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

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/
"""

"""
LINK ENVIRONMENTAL SETTINGS FILE:
ln -s -f settings.{ENV}.py settings.py

CREATE MIGRATION:
python3 manage.py makemigrations leagues projections

UPDATE DATABASE:
python3 manage.py migrate

RUN SERVER:
python3 manage.py runserver localhost:8080
python3 manage.py runserver 10.211.55.2:8080
"""
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/2.0/howto/deployment/checklist/


# Application definition

INSTALLED_APPS = [
    'leagues.apps.LeaguesConfig',
    'projections.apps.ProjectionsConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

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

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        '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 = 'gsa.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


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

STATIC_URL = '/static/'

STATIC_ROOT = 'static'
# STATIC_ROOT = os.path.join(BASE_DIR, "..", "www", "static")

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'gsa', 'static'),
    # '/var/www/static/',
    # os.path.join('static'),
]

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    #'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Global Variables
TEAM_TOOLS_REDIRECT = '/team_tools'
USER_REDIRECT = '/user'
LOGIN_REDIRECT_URL = '/user'

BATTER_RAZZBALL_ROS_URL = 'http://razzball.com/restofseason-hitterprojections/'
PITCHER_RAZZBALL_ROS_URL = 'http://razzball.com/restofseason-pitcherprojections/'
BATTER_RAZZBALL_OS_URL = 'http://razzball.com/steamer-hitter-projections/'
PITCHER_RAZZBALL_OS_URL = 'http://razzball.com/steamer-pitcher-projections/'

BATTER_FANTPRO_ROS_URL = "https://www.fantasypros.com/mlb/projections/ros-hitters.php"
PITCHER_FANTPRO_ROS_URL = "https://www.fantasypros.com/mlb/projections/ros-pitchers.php"
BATTER_FANTPRO_OS_URL = "https://www.fantasypros.com/mlb/projections/hitters.php"
PITCHER_FANTPRO_OS_URL = "https://www.fantasypros.com/mlb/projections/pitchers.php"

BATTER_ROS_URL = BATTER_FANTPRO_ROS_URL
PITCHER_ROS_URL = PITCHER_FANTPRO_ROS_URL
BATTER_OS_URL = BATTER_FANTPRO_OS_URL
PITCHER_OS_URL = PITCHER_FANTPRO_OS_URL
