epcstages/common/settings.py

155 lines
4.6 KiB
Python

# Django settings for epcstages project.
import os
PROJECT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUG = True
ADMINS = (
('Claude Paroz', 'claude@2xlibre.net'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_PATH, 'database.db'),
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
TIME_ZONE = 'Europe/Zurich'
LANGUAGE_CODE = 'fr'
USE_I18N = True
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = False
# Absolute filesystem path to the directory that will hold user-uploaded files.
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
MEDIA_URL = ''
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
STATIC_URL = '/static/'
# Set it in local_settings.py.
SECRET_KEY = ''
MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'common.middleware.LoginRequiredMiddleware',
]
ROOT_URLCONF = 'common.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'common.wsgi.application'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(PROJECT_PATH, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
# Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
# list if you haven't customized them:
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
],
},
},
]
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'tabimport',
'stages',
'candidats',
)
FILE_UPLOAD_HANDLERS = ["django.core.files.uploadhandler.TemporaryFileUploadHandler"]
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
ALLOWED_HOSTS = ['localhost', 'stages.pierre-coullery.ch']
FABRIC_HOST = 'stages.pierre-coullery.ch'
FABRIC_USERNAME = ''
# Mapping between column names of a tabular file and Student field names
STUDENT_IMPORT_MAPPING = {
'NOCLOEE': 'ext_id',
'NOM': 'last_name',
'PRENOM': 'first_name',
'RUE': 'street',
'LOCALITE': 'city', # pcode is separated from city in prepare_import
'TEL_PRIVE': 'tel',
'TEL_MOBILE': 'mobile',
'EMAIL_RPN': 'email',
'DATENAI': 'birth_date',
'NAVS13': 'avs',
'SEXE': 'gender',
'CLASSE_ACTUELLE': 'klass',
'LIB_BRANCHE_OPTION': 'option_ase',
}
CORPORATION_IMPORT_MAPPING = {
'NO_EMPLOYEUR' : 'ext_id',
'EMPLOYEUR' : 'name',
'RUE_EMPLOYEUR': 'street',
'LOCALITE_EMPLOYEUR': 'city',
'TEL_EMPLOYEUR': 'tel',
'CANTON_EMPLOYEUR' : 'district',
}
INSTRUCTOR_IMPORT_MAPPING = {
'NO_FORMATEUR': 'ext_id',
'NOM_FORMATEUR': 'last_name',
'PRENOM_FORMATEUR': 'first_name',
'TEL_FORMATEUR': 'tel',
'MAIL_FORMATEUR': 'email',
}
CHARGE_SHEET_TITLE = "Feuille de charge pour l'année scolaire 2017-2018"
# Maximum numbers of periods per teacher per year
MAX_ENS_PERIODS = 1900
MAX_ENS_FORMATION = 250
DATE_LIEU_EXAMEN_EDE = "mercredi 7 mars 2018, à 13h30, salle 405"
if 'TRAVIS' in os.environ:
SECRET_KEY = 'secretkeyfortravistests'
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
else:
from .local_settings import *