epcstages/common/settings.py

132 lines
4.4 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': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': os.path.join(PROJECT_PATH, 'database.db'), # Or path to database file if using sqlite3.
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.
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
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.
# Example: "/home/media/media.lawrence.com/media/"
2012-11-22 17:48:41 +01:00
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
2012-11-06 17:54:33 +01:00
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/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.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
2012-11-06 17:54:33 +01:00
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
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',
)
2016-01-19 10:27:53 +01:00
FILE_UPLOAD_HANDLERS = ["django.core.files.uploadhandler.TemporaryFileUploadHandler"]
2013-07-02 14:57:12 +02:00
ALLOWED_HOSTS = ['localhost', 'stages.pierre-coullery.ch']
2016-01-19 10:27:53 +01:00
# Mapping between column names of a tabular file and Student field names
STUDENT_IMPORT_MAPPING = {
'Num élève': 'ext_id',
'Nom élève': 'last_name',
'Prénom élève': 'first_name',
'Rue élève': 'street',
'Localité élève': 'city', # pcode is separated from city in prepare_import
'Tél. élève': 'tel',
'Natel élève': 'mobile',
'Email élève': 'email',
'Date nais. élève': 'birth_date',
'Classe': 'klass',
}
2015-09-22 18:29:42 +02:00
from .local_settings import *