<reponame>AndrewBuck/cosmic
"""
Django settings for cosmic project.

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

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 = 'THIS_IS_NOT_SECRET____IN_GIT_REPO____MUST_CHANGE_FOR_PRODUCTION_SITE'

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

ALLOWED_HOSTS = ['*']
INTERNAL_IPS = '127.0.0.1'


# Application definition

INSTALLED_APPS = [
    'cosmicapp.apps.CosmicappConfig', 

    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.humanize',
    'debug_toolbar',

    'django_extensions',

    'django.contrib.gis',

    'django_celery_results',

    'paypal.standard.ipn',
]

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',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
]

ROOT_URLCONF = 'cosmic.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 = 'cosmic.wsgi.application'


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

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': 'cosmic',
        'USER': 'cosmicweb',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '',
    },
    'OPTIONS': {
        'timeout': 60,
    }
}

# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

# 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/'




PAYPAL_TEST = True
if PAYPAL_TEST:
    PAYPAL_RECEIVER_EMAIL = '<EMAIL>'
else:
    PAYPAL_RECEIVER_EMAIL = '<EMAIL>'

LOGIN_URL =  '/login/'
LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = '/'

MEDIA_ROOT = '/cosmicmedia/'
COSMIC_STATIC = '/cosmicstatic/'
STATICFILES_DIRS = [
    COSMIC_STATIC,
]

CELERY_RESULT_BACKEND = 'django-db'

SUPPORTED_IMAGE_TYPES = [".fit", ".fits", ".fts", ".new"]

# When running parseHeaders these keys are not written into the database at all.
IGNORED_KEYS = ['date:modify', 'date:create']

# These keys are written into the database as ImageHeader entries, but are not turned into ImageProperty entries.
NON_PROPERTY_KEYS = [
    'fits:wcsdim', 'fits:wcsaxes', 'fits:crpix1', 'fits:crpix2', 'fits:cunit1', 'fits:cunit2',
    'fits:ctype1', 'fits:ctype2',
    'fits:crval1', 'fits:crval2',
    'fits:crota1', 'fits:crota2',
    'fits:latpole', 'fits:lonpole',
    'fits:a_0_0', 'fits:a_0_1', 'fits:a_1_0', 'fits:a_1_1', 'fits:a_0_2', 'fits:a_2_0',
    'fits:b_0_0', 'fits:b_0_1', 'fits:b_1_0', 'fits:b_1_1', 'fits:b_0_2', 'fits:b_2_0',
    'fits:cd1_1', 'fits:cd1_2', 'fits:cd2_1', 'fits:cd2_2',
    'fits:cd001001', 'fits:cd001002', 'fits:cd002001', 'fits:cd002002',
    'fits:cdelt1', 'fits:cdelt2',
    'fits:ap_0_0', 'fits:ap_0_1', 'fits:ap_1_0', 'fits:ap_1_1', 'fits:ap_0_2', 'fits:ap_2_0',
    'fits:bp_0_0', 'fits:bp_0_1', 'fits:bp_1_0', 'fits:bp_1_1', 'fits:bp_0_2', 'fits:bp_2_0',
    'fits:pc0_0', 'fits:pc0_1', 'fits:pc1_0', 'fits:pc1_1',
    'fits:pc1_2', 'fits:pc2_1', 'fits:pc2_2',
    'fits:ap_order', 'fits:bp_order', 'fits:a_order', 'fits:b_order',
    'fits:wat0_001', 'fits:wat1_001', 'fits:wat2_001', 'fits:wat3_001',
    'fits:ltm1_1', 'fits:ltm2_2', 'fits:ltm3_3',
    'fits:ltv1', 'fits:ltv2', 'fits:ltv3',
    'fits:waxmap01',
    'fits:tr1_0', 'fits:tr1_1', 'fits:tr1_2', 'fits:tr1_3', 'fits:tr1_4', 'fits:tr1_5', 'fits:tr1_6', 'fits:tr1_7',
    'fits:tr1_8', 'fits:tr1_9', 'fits:tr1_10', 'fits:tr1_11', 'fits:tr1_12', 'fits:tr1_13', 'fits:tr1_14',
    'fits:tr2_0', 'fits:tr2_1', 'fits:tr2_2', 'fits:tr2_3', 'fits:tr2_4', 'fits:tr2_5', 'fits:tr2_6', 'fits:tr2_7',
    'fits:tr2_8', 'fits:tr2_9', 'fits:tr2_10', 'fits:tr2_11', 'fits:tr2_12', 'fits:tr2_13', 'fits:tr2_14'
    ]

