settings – Les paramètres de configuration du projet

settings.DEV = False

Est-on sur la note de dev ?

settings.PROD = True

Est-on sur la note de prod ?

settings.DEFAULT_CHARSET = 'utf-8'

Charset par défaut

settings.DEBUG = False

Mode de debug

settings.REPORT_BUGS_EMAIL = 'notekfet2015@crans.org'

Adresse mail à qui envoyer des problèmes durant l’exécution

settings.ADMINS = [('Report bugs to', 'notekfet2015@crans.org')]

Liste des administrateurs et de leur mails

settings.ALLOWED_HOSTS = ['.crans.org']

Hôtes pour lesquelles la note a le droit de répondre

settings.NOTE_ROOT_URL = '/note/'

Url racine

settings.NOTE_LOGIN_URL = '/note/'

Url de la page de login

settings.ROOT_PATH = '/home/note/note-kfet-2015-django/note/'

Chemin absolu du répertoire racine du client django (Le os.path.join est là pour assurer la présence du trailing slash)

settings.SERVER_EMAIL = 'notekfet2015@crans.org'

From des messages d’erreur

settings.MANAGERS = [('Report bugs to', 'notekfet2015@crans.org')]

A tuple in the same format as ADMINS that specifies who should get broken link notifications when BrokenLinkEmailsMiddleware is enabled.

settings.DATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'AUTOCOMMIT': True, 'ATOMIC_REQUESTS': False, 'NAME': 'django_client', 'CONN_MAX_AGE': 0, 'TIME_ZONE': None, 'OPTIONS': {}, 'HOST': '', 'USER': 'note', 'TEST': {'COLLATION': None, 'CHARSET': None, 'NAME': None, 'MIRROR': None}, 'PASSWORD': '', 'PORT': ''}}

Base de données pour stocker les data django. Dans le cas de la NoteKfet2015, elle n’est utilisé que pour stocker les sessions puisque tout est fait dans le backend.

settings.TIME_ZONE = 'Europe/Paris'

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. If running in a Windows environment this must be set to the same as your system time zone.

settings.LANGUAGE_CODE = 'fr-FR'

Language code for this installation. All choices can be found here: http://www.i18nguy.com/unicode/language-identifiers.html

settings.SITE_ID = 1

The ID, as an integer, of the current site in the django_site database table. This is used so that application data can hook into specific sites and a single database can manage content for multiple sites.

settings.USE_I18N = True

If you set this to False, Django will make some optimizations so as not to load the internationalization machinery.

settings.USE_L10N = True

If you set this to False, Django will not format dates, numbers and calendars according to the current locale.

settings.USE_TZ = True

If you set this to False, Django will not use timezone-aware datetimes.

settings.MEDIA_ROOT = '/home/note/note-kfet-2015-django/media/'

Absolute filesystem path to the directory that will hold user-uploaded files. Example: “/home/media/media.lawrence.com/media/”

settings.MEDIA_URL = '/note/media/'

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/

settings.STATIC_URL = '/static/'

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/” URL prefix for static files. Example: “http://media.lawrence.com/static/

settings.STATICFILES_DIRS = ('/home/note/note-kfet-2015-django/../static/',)

Additional locations of static files

settings.STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder')

List of finder classes that know how to find static files in various locations.

settings.TEMPLATES = [{'DIRS': ['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']}, 'BACKEND': 'django.template.backends.django.DjangoTemplates'}]

List of callables that know how to import templates from various sources.

settings.MIDDLEWARE = ['django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware']

A tuple of middleware classes to use. See Middleware.

settings.ROOT_URLCONF = 'urls'

A string representing the full Python import path to your root URLconf. For example: “mydjangoapps.urls”. Can be overridden on a per-request basis by setting the attribute urlconf on the incoming HttpRequest object.

settings.WSGI_APPLICATION = 'note.wsgi.application'

Python dotted path to the WSGI application used by Django’s runserver.

settings.INSTALLED_APPS = ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'note')

A tuple of strings designating all applications that are enabled in this Django installation. Each string should be a full Python path to a Python package that contains a Django application, as created by django-admin.py startapp.

settings.LOGGING = {'loggers': {'django.request': {'level': 'ERROR', 'propagate': True, 'handlers': ['mail_admins']}}, 'version': 1, 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}}, 'disable_existing_loggers': False, 'handlers': {'mail_admins': {'class': 'django.utils.log.AdminEmailHandler', 'filters': ['require_debug_false'], 'level': 'ERROR'}}}

A sample logging configuration. The only tangible logging performed by this configuration is to send an email to the site admins on every HTTP 500 error when DEBUG=False. See http://docs.djangoproject.com/en/dev/topics/logging for more details on how to customize your logging configuration.

ttl des cookies Django en secondes

settings.MAX_PHOTO_SIZE = 870000

Taille max autorisée pour les photos

settings.PHOTOS_PATH = '/home/note/note-kfet-2015-django/media/photos/'

Dossier où sont stockées les photos temporairement

settings.PHOTOS_URL = '/note/media/photos/'

URL par laquelle on accède aux photos

settings.TIME_BEFORE_PHOTO_DELETE = 300

Temps avant de supprimer un fichier de photo temporaire Pendant cet intervalle de temps, la photo pourra être affichée sans être redemandée au serveur NK2015

settings.NK2015_IP = '127.0.0.1'

IP où joindre le serveur NK2015

settings.NK2015_PORT = 4242

Port d’écoute du serveur NK2015

settings.DATETIME_INPUT_FORMAT = u'%Y-%m-%d %H:%M:%S'

Format avec lequel les dates arrivent du serveur NK2015

settings.DATETIME_RENDERING_FORMAT = u'Le %d/%m/%Y \xe0 %H:%M:%S'

Format d’affichage des dates

settings.YEAR_1900s_OVER = 69

Année jusqu’à laquelle les dates sont en 20nn

settings.ACL_MASKS = {'0_basic': (u'Droits basiques', [['overforced', 'transactions_admin', 'chgpass', 'comptes', 'boutons', 'admin', 'digicode'], ['overforced', 'transactions_admin', 'chgpass', 'comptes', 'boutons', 'admin', 'digicode'], True]), '1_note': (u'Droits note seulement', [['myself', 'overforced', 'transactions_admin', 'chgpass', 'comptes', 'boutons', 'admin', 'digicode'], ['myself', 'overforced', 'transactions_admin', 'chgpass', 'comptes', 'boutons', 'admin', 'digicode'], True]), '2_all': (u'Tous mes droits', [[], [], False])}

Dico recensant les masques de droits : keyword -> ("nom à afficher", <masque>) ils seront proposés dans l’ordre des keywords

settings.dummy()[source]

Chaîne à traduire. Les valeurs étant générées à la volée ou ne pouvant être déclarable comme à traduire le sont ici.