"""
Django settings for PaperMetrics project.

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

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

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

import os
from django.utils.translation import ugettext_lazy as _
# 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/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 's%g)_@gxx!s(x-^!=fr$oc4!s-@@macvma^m7pur4-1yc69r#-'

# 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',
    'api',
    'frontend',
    'authorization',
    'crispy_forms',
    'django_celery_beat'
]

CRISPY_TEMPLATE_PACK = 'bootstrap4'

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.locale.LocaleMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
SITE_ID = 1
ROOT_URLCONF = 'PaperMetrics.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(BASE_DIR,'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',
                'django.template.context_processors.i18n',
            ],
        },
    },
]

WSGI_APPLICATION = 'PaperMetrics.wsgi.application'

LOGIN_REDIRECT_URL = "/login/"

AUTH_USER_MODEL = 'authorization.User'

# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
#
# DATABASES = {
#     'default': {
#         'ENGINE': 'django.db.backends.sqlite3',
#         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#     }
# }

DATABASES = {
    'default':{
        'ENGINE':'django.db.backends.postgresql_psycopg2',
        'HOST':'',
        'PORT':'',
        'NAME':'paper',
        'USER':'postgres',
        'PASSWORD':'vihas007'
    }
}

# Password validation
# https://docs.djangoproject.com/en/3.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',
    },
]

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    }
}

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

LANGUAGE_CODE = 'en-us'
LANGUAGES = (
    ('tr', _('Turkish')),
    ('en-us', _('English')),)

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


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

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,'staticfiles')

STATICFILES_DIRS = (
    os.path.join(BASE_DIR,'static'),
)

LOGIN_URL = "/login/"

AREAS = [
            'Agricultural and Biological Sciences', 'Arts and Humanities',
            'Business, Management and Accounting', 'Chemistry',
            'Computer Science','Earth and Planetary Sciences', 'Economics, Econometrics and Finance',
            'Engineering', 'Linguistics', 'Mathematics', 'Medicine and Dentistry',
            'Philosophy', 'Physics and Astronomy', 'Psychology', 'Social Sciences',
            'Sports and Recreations',
         ]

SUBDISCIPLINES = {
    'Agricultural and Biological Sciences':['Aerobiology','Agrology','Anatomy','Biochemistry','Bioinformatics','Biophysics','Botany','Chronobiology','Cryobiology','Ecology','Genetics','Horticulture','Limnology','Marine biology','Microbiology','Molecular biology','Mycology','Immunology'],
    'Arts and Humanities':['Library and information science','Arşivcilik ve Arşiv Yönetimi','Bilgi ve Belge Yönetimi','Art','Creative Writing','Dance','Design','English literature','Film studies and film criticism','History','Literature and cultural studies','Music','Philosophy','Religious studies',"Women's studies and Gender studies"],
    'Business, Management and Accounting':['Accounting','Business','Business ethics','Finance','Labor economics','Information systems','Management','Marketing','Manufacturing'],
    'Chemistry':['Alchemy','Analytical chemistry','Biochemistry','Computational chemistry','Inorganic chemistry','Organic chemistry','Physical chemistry','Theoretical chemistry'],
    'Engineering':['Aerospace engineering','Agricultural engineering','Architectural engineering','Bioengineering','Chemical engineering','Civil engineering','Computer engineering','Control systems engineering','Electrical engineering','Electronic engineering','Environmental engineering','Industrial engineering','Materials engineering','Mechanical engineering','Naval engineering','Nuclear engineering','Optical engineering','Optical engineering','Transportation engineering'],
    'Computer Science':['Algorithms','Computing','Artificial intelligence','Information technology','Software engineering','Robotics','Programming languages'],
    'Earth and Planetary Sciences':['Earth science','Environmental science','Geodesy','Geology','Geomorphology','Geophysics','Glaciology','Meteorology','Geography','Geomorphology','Oceanography','Mineralogy','Paleontology','Sedimentology','Soil science'],
    'Economics':['Game theory','Human development theory','Microeconomics','Macroeconomics'],
    'Linguistics':['Semantics','Syntax','Morphology','Phonology'],
    'Mathematics':['Algebra','Analysis','Game theory','Calculas','Geometry','Number theory','Probability theory','Statistics','Topology'],
    'Medicine and Dentistry':['Cardiology','Dental hygiene','Endodontics','Endocrinology and diabetology','Epidemiology','Geriatrics','Forensics','Hematology','Internal medicine','Nephrology','Neurology','Neurosurgery','Nursing','Orthodontics','Pathology','Pediatrics','Pharmacology','Psychiatry','Periodontics','Prosthodontics','Surgery','Rheumatology','Toxicology'],
    'Philosophy':['Aesthetics','Continental philosophy','Eastern philosophy','Epistemology','Ethics','History of philosophy','Metaphysics','Metaphysics','Philosophy of language','Philosophy of mathematics','Philosophy of mind','Philosophy of religion','Philosophy of science'],
    'Physics and Astronomy':['Astrophysics','Atomic, molecular, and optical physics','Biophysics','Computational physics','Condensed matter physics','Cosmology','Cosmogony','Cryogenics','Fluid dynamics','Optics','Nuclear physics','Plasma physics','Particle physics','Vehicle dynamics'],
    'Psychology':['Behavioural psychology','Cognitive psychology','Cognitive science','Developmental psychology','Experimental psychology','Neuropsychology','Organisational psychology','Psychiatry','Parapsychology','Psychoanalysis','Social psychology'],
    'Social Sciences':['Anthropology','Archaeology','Communications','Economics','Ethnology','Ethnomusicology','Folklore','Geography','Linguistics','Political science','Psychology','Semiotics','Sociology','Sport biomechanics'],
    'Sports and Recreations':['Adapted Physical Activity','Exercise physiology','Motor learning','Physical therapy','Sport Management','Sports Medicine','Sports & Exercise Psychology','Sport Sociology']
}


MENDELEY_SECRET = 'ZaDDZKH64gIeWFkj'
MENDELEY_ID = 8198


LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]
TWITTER_BEARER = 'AAAAAAAAAAAAAAAAAAAAAD48KgEAAAAAnX7GlKfiG2ULH%2F%2FEsEvy%2BYgRgz0%3DrRHsFuHLHaKLR2rJ0xAr6OMPVFHcvTFVh5oEfUUiUbA7LdYvO3'
EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'johndo521999@gmail.com'
EMAIL_HOST_PASSWORD = 'pubg12345'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER


CELERY_BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redis://localhost:6379'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TASK_SERIALIZER = 'json'
