settings.py 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. """
  2. Django settings for djadhere project.
  3. Generated by 'django-admin startproject' using Django 1.10.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.10/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.10/ref/settings/
  8. """
  9. import os
  10. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  11. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  12. # Quick-start development settings - unsuitable for production
  13. # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
  14. # SECURITY WARNING: keep the secret key used in production secret!
  15. SECRET_KEY = '*d4p%8@loemk$p=65sd=23e#1aw4fhbr8%cme$8o318g7in$t_'
  16. # SECURITY WARNING: don't run with debug turned on in production!
  17. DEBUG = True
  18. ALLOWED_HOSTS = []
  19. SITE_TITLE = 'tetaneutral.net'
  20. SITE_HEADER = 'Administration de tetaneutral.net'
  21. # Application definition
  22. INSTALLED_APPS = [
  23. 'accounts',
  24. 'adhesions',
  25. 'services',
  26. 'banking',
  27. 'stocking',
  28. 'djadhere',
  29. 'bootstrap3',
  30. 'leaflet',
  31. 'mptt',
  32. 'django.contrib.admin',
  33. 'django.contrib.auth',
  34. 'django.contrib.contenttypes',
  35. 'django.contrib.sessions',
  36. 'django.contrib.messages',
  37. 'django.contrib.staticfiles',
  38. 'django.contrib.gis',
  39. 'django.contrib.humanize',
  40. ]
  41. MIDDLEWARE = [
  42. 'django.middleware.security.SecurityMiddleware',
  43. 'django.contrib.sessions.middleware.SessionMiddleware',
  44. 'django.middleware.common.CommonMiddleware',
  45. 'django.middleware.csrf.CsrfViewMiddleware',
  46. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  47. 'django.contrib.messages.middleware.MessageMiddleware',
  48. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  49. 'adhesions.middleware.CorporationMiddleware',
  50. ]
  51. ROOT_URLCONF = 'djadhere.urls'
  52. TEMPLATES = [
  53. {
  54. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  55. 'DIRS': [],
  56. 'APP_DIRS': True,
  57. 'OPTIONS': {
  58. 'context_processors': [
  59. 'django.template.context_processors.debug',
  60. 'django.template.context_processors.request',
  61. 'django.contrib.auth.context_processors.auth',
  62. 'django.contrib.messages.context_processors.messages',
  63. ],
  64. },
  65. },
  66. ]
  67. WSGI_APPLICATION = 'djadhere.wsgi.application'
  68. # Database
  69. # https://docs.djangoproject.com/en/1.10/ref/settings/#databases
  70. DATABASES = {
  71. 'default': {
  72. #'ENGINE': 'django.db.backends.sqlite3',
  73. 'ENGINE': 'django.contrib.gis.db.backends.spatialite',
  74. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  75. }
  76. }
  77. SPATIALITE_LIBRARY_PATH = 'mod_spatialite'
  78. # Password validation
  79. # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
  80. AUTH_PASSWORD_VALIDATORS = [
  81. {
  82. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  83. },
  84. {
  85. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  86. },
  87. {
  88. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  89. },
  90. {
  91. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  92. },
  93. ]
  94. AUTHENTICATION_BACKENDS = [
  95. 'django.contrib.auth.backends.ModelBackend',
  96. 'accounts.backends.EmailBackend',
  97. 'adhesions.backends.AdhesionBackend',
  98. ]
  99. # Internationalization
  100. # https://docs.djangoproject.com/en/1.10/topics/i18n/
  101. LANGUAGE_CODE = 'fr-FR'
  102. TIME_ZONE = 'Europe/Paris'
  103. USE_I18N = True
  104. USE_L10N = True
  105. USE_TZ = True
  106. # Static files (CSS, JavaScript, Images)
  107. # https://docs.djangoproject.com/en/1.10/howto/static-files/
  108. STATIC_URL = '/static/'
  109. LOGOUT_REDIRECT_URL = 'adhesion-detail'
  110. BOOTSTRAP3 = {
  111. # The URL to the jQuery JavaScript file
  112. # If not set, "build-in" CDN is used (maxcdn)
  113. # 'jquery_url': '//code.jquery.com/jquery.min.js',
  114. # 'jquery_url': STATIC_URL + 'jquery/dist/jquery.js',
  115. # The Bootstrap base URL
  116. # If not set, "build-in" CDN is used (maxcdn)
  117. # 'base_url': '//netdna.bootstrapcdn.com/bootstrap/3.2.0/',
  118. # 'base_url': STATIC_URL + 'bootstrap/dist/',
  119. # The complete URL to the Bootstrap CSS file
  120. # (None means derive it from base_url)
  121. 'css_url': None,
  122. # The complete URL to the Bootstrap CSS file
  123. # (None means no theme)
  124. 'theme_url': None,
  125. # The complete URL to the Bootstrap JavaScript file
  126. # (None means derive it from base_url)
  127. 'javascript_url': None,
  128. }
  129. LEAFLET_CONFIG = {
  130. 'DEFAULT_CENTER': (43.6044, 1.4433),
  131. 'DEFAULT_ZOOM': 12,
  132. }