epcstages/common/settings.py

156 lines
4.6 KiB
Python
Raw Normal View History

2012-11-06 17:54:33 +01:00
# 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': {
2018-01-11 14:39:12 +01:00
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_PATH, 'database.db'),
2012-11-06 17:54:33 +01:00
'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.
2012-11-22 17:48:41 +01:00
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
MEDIA_URL = '/media/'
2012-11-06 17:54:33 +01:00
# 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')
2012-11-06 17:54:33 +01:00
STATIC_URL = '/static/'
2012-11-30 09:33:48 +01:00
# Set it in local_settings.py.
SECRET_KEY = ''
2012-11-06 17:54:33 +01:00
2016-09-08 15:46:58 +02:00
MIDDLEWARE = [
2012-11-06 17:54:33 +01:00
'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',
2016-09-08 15:46:58 +02:00
]
2012-11-06 17:54:33 +01:00
ROOT_URLCONF = 'common.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'common.wsgi.application'
2016-01-15 20:53:57 +01:00
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',
],
},
},
]
2012-11-06 17:54:33 +01:00
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
2012-11-13 09:40:31 +01:00
'tabimport',
2012-11-06 17:54:33 +01:00
'stages',
2017-10-18 18:52:59 +02:00
'candidats',
2012-11-06 17:54:33 +01:00
)
2016-01-19 10:27:53 +01:00
FILE_UPLOAD_HANDLERS = ["django.core.files.uploadhandler.TemporaryFileUploadHandler"]
2016-09-08 16:04:51 +02:00
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
2013-07-02 14:57:12 +02:00
ALLOWED_HOSTS = ['localhost', 'stages.pierre-coullery.ch']
FABRIC_HOST = 'stages.pierre-coullery.ch'
FABRIC_USERNAME = ''
2016-01-19 10:27:53 +01:00
# Mapping between column names of a tabular file and Student field names
STUDENT_IMPORT_MAPPING = {
2017-07-19 11:33:54 +02:00
'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',
2016-01-19 10:27:53 +01:00
}
CHARGE_SHEET_TITLE = "Feuille de charge pour l'année scolaire 2017-2018"
2017-08-30 17:58:53 +02:00
# Maximum numbers of periods per teacher per year
MAX_ENS_PERIODS = 1900
MAX_ENS_FORMATION = 250
2018-01-26 18:19:16 +01:00
DATE_LIEU_EXAMEN_EDE = "mercredi 7 mars 2018, à 13h30, salle 405"
2017-07-18 10:23:51 +02:00
if 'TRAVIS' in os.environ:
SECRET_KEY = 'secretkeyfortravistests'
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
2017-07-18 10:23:51 +02:00
else:
from .local_settings import *