162 lines
4.5 KiB
Python
162 lines
4.5 KiB
Python
"""
|
|
Django settings for polyclinic_scheduling project.
|
|
|
|
Generated by 'django-admin startproject' using Django 3.0.6.
|
|
|
|
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 decouple import config, Csv
|
|
from dj_database_url import parse as db_url
|
|
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 = config('SECRET_KEY')
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
DEBUG = config('DEBUG', default=False, cast=bool)
|
|
|
|
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='127.0.0.1', cast=Csv())
|
|
|
|
INTERNAL_IPS = config('INTERNAL_IPS',default='127.0.0.1',cast=Csv())
|
|
|
|
# Application definition
|
|
|
|
INSTALLED_APPS = [
|
|
'django.contrib.auth',
|
|
'django.contrib.contenttypes',
|
|
'django.contrib.sessions',
|
|
'django.contrib.messages',
|
|
'django.contrib.staticfiles',
|
|
|
|
'apps.hospital',
|
|
'apps.polyclinic',
|
|
'apps.employee',
|
|
'apps.schedule',
|
|
|
|
'apps.RUG_template',
|
|
|
|
'django.contrib.admin', # Admin add here, so that we can overrule the password reset template
|
|
]
|
|
|
|
if DEBUG:
|
|
INSTALLED_APPS.append('debug_toolbar')
|
|
|
|
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',
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
]
|
|
|
|
if DEBUG:
|
|
MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware')
|
|
|
|
ROOT_URLCONF = 'polyclinic_scheduling.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',
|
|
],
|
|
},
|
|
},
|
|
]
|
|
|
|
WSGI_APPLICATION = 'polyclinic_scheduling.wsgi.application'
|
|
|
|
|
|
# Database
|
|
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
|
|
|
|
DATABASES = {
|
|
'default': config(
|
|
'DATABASE_URL',
|
|
default='sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
cast=db_url
|
|
)
|
|
}
|
|
|
|
# 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',
|
|
},
|
|
]
|
|
|
|
LOGIN_REDIRECT_URL = '/'
|
|
LOGOUT_REDIRECT_URL = '/'
|
|
|
|
# Internationalization
|
|
# https://docs.djangoproject.com/en/3.0/topics/i18n/
|
|
|
|
LANGUAGE_CODE = 'en-us'
|
|
|
|
LANGUAGES = [
|
|
('nl', _('Dutch')),
|
|
('en', _('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/'
|
|
|
|
STATICFILES_DIRS = [
|
|
os.path.join(BASE_DIR, "static"),
|
|
]
|
|
|
|
STATIC_ROOT = config('STATIC_ROOT',None)
|
|
|
|
EMAIL_FROM_ADDRESS = config('EMAIL_FROM_ADDRESS', default='Do not reply<no-reply@rug.nl>')
|
|
EMAIL_HOST = config('EMAIL_HOST', default='')
|
|
EMAIL_HOST_USER = config('EMAIL_HOST_USER', default='')
|
|
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD', default='')
|
|
EMAIL_PORT = config('EMAIL_PORT', default=25, cast=int)
|
|
EMAIL_USE_TLS = config('EMAIL_USE_TLS', default=False, cast=bool)
|
|
|
|
if DEBUG:
|
|
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
|
|
EMAIL_FILE_PATH = os.path.join(BASE_DIR, 'sent_emails') |