settings.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. """
  2. Django settings for transparency project.
  3. Generated by 'django-admin startproject' using Django 1.8.1.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.8/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.8/ref/settings/
  8. """
  9. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  10. import os
  11. import sys
  12. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  15. # SECURITY WARNING: don't run with debug turned on in production!
  16. DEBUG = True
  17. ALLOWED_HOSTS = []
  18. # Application definition
  19. INSTALLED_APPS = (
  20. 'django.contrib.admin',
  21. 'django.contrib.auth',
  22. 'django.contrib.contenttypes',
  23. 'django.contrib.sessions',
  24. 'django.contrib.messages',
  25. 'django.contrib.staticfiles',
  26. 'costs',
  27. )
  28. MIDDLEWARE_CLASSES = (
  29. 'django.contrib.sessions.middleware.SessionMiddleware',
  30. 'django.middleware.common.CommonMiddleware',
  31. 'django.middleware.csrf.CsrfViewMiddleware',
  32. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  33. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  34. 'django.contrib.messages.middleware.MessageMiddleware',
  35. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  36. 'django.middleware.security.SecurityMiddleware',
  37. )
  38. ROOT_URLCONF = 'transparency.urls'
  39. TEMPLATES = [
  40. {
  41. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  42. 'DIRS': [],
  43. 'APP_DIRS': True,
  44. 'OPTIONS': {
  45. 'context_processors': [
  46. 'django.template.context_processors.debug',
  47. 'django.template.context_processors.request',
  48. 'django.contrib.auth.context_processors.auth',
  49. 'django.contrib.messages.context_processors.messages',
  50. ],
  51. },
  52. },
  53. ]
  54. WSGI_APPLICATION = 'transparency.wsgi.application'
  55. # Database
  56. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  57. DATABASES = {
  58. 'default': {
  59. 'ENGINE': 'django.db.backends.sqlite3',
  60. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  61. }
  62. }
  63. # Internationalization
  64. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  65. LANGUAGE_CODE = 'fr-fr'
  66. TIME_ZONE = 'Europe/Paris'
  67. USE_I18N = True
  68. USE_L10N = True
  69. USE_TZ = True
  70. # Static files (CSS, JavaScript, Images)
  71. # https://docs.djangoproject.com/en/1.8/howto/static-files/
  72. STATIC_URL = '/static/'
  73. ## Non-technic Specifics
  74. import datetime
  75. PROVISIONING_DURATIONS = [
  76. (datetime.timedelta(days=365*3), '3 ans'),
  77. (datetime.timedelta(days=365*5), '5 ans'),
  78. ]
  79. try:
  80. from .local_settings import *
  81. except ImportError:
  82. sys.stderr.write('Create a local_settings.py, see README.md')
  83. exit(1)