base.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. """
  2. Django settings for wifiwithme project.
  3. Generated by 'django-admin startproject' using Django 1.9.2.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.9/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.9/ref/settings/
  8. """
  9. import os
  10. import sys
  11. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  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.9/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = 'e7#ho6q5-vjt58#elu#fyl^qzygvz=dkhv@fau96bfe+6kjipt'
  17. ALLOWED_HOSTS = []
  18. # Application definition
  19. # Add apps/ to the Python path
  20. sys.path = [os.path.join(BASE_DIR, 'apps'), BASE_DIR] + sys.path
  21. INSTALLED_APPS = [
  22. 'django.contrib.auth',
  23. 'django.contrib.contenttypes',
  24. 'django.contrib.sessions',
  25. 'django.contrib.messages',
  26. 'django.contrib.staticfiles',
  27. 'core',
  28. 'contribmap',
  29. 'pages',
  30. 'django.contrib.admin',
  31. 'phonenumber_field',
  32. ]
  33. MIDDLEWARE_CLASSES = [
  34. 'django.middleware.security.SecurityMiddleware',
  35. 'django.contrib.sessions.middleware.SessionMiddleware',
  36. 'django.middleware.common.CommonMiddleware',
  37. 'django.middleware.csrf.CsrfViewMiddleware',
  38. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  39. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  40. 'django.contrib.messages.middleware.MessageMiddleware',
  41. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  42. ]
  43. ROOT_URLCONF = 'wifiwithme.core.urls'
  44. TEMPLATES = [
  45. {
  46. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  47. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  48. 'APP_DIRS': True,
  49. 'OPTIONS': {
  50. 'context_processors': [
  51. 'django.template.context_processors.debug',
  52. 'django.template.context_processors.request',
  53. 'django.contrib.auth.context_processors.auth',
  54. 'django.contrib.messages.context_processors.messages',
  55. ],
  56. },
  57. },
  58. ]
  59. WSGI_APPLICATION = 'wifiwithme.wsgi.application'
  60. # Database
  61. # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  62. DATABASES = {
  63. 'default': {
  64. 'ENGINE': 'django.db.backends.sqlite3',
  65. 'NAME': os.path.join(os.path.dirname(BASE_DIR), 'db.sqlite3'),
  66. }
  67. }
  68. # Password validation
  69. # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
  70. AUTH_PASSWORD_VALIDATORS = [
  71. {
  72. 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  73. },
  74. {
  75. 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  76. },
  77. {
  78. 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  79. },
  80. {
  81. 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  82. },
  83. ]
  84. # Internationalization
  85. # https://docs.djangoproject.com/en/1.9/topics/i18n/
  86. LANGUAGE_CODE = 'fr-fr'
  87. TIME_ZONE = 'UTC'
  88. USE_I18N = True
  89. USE_L10N = True
  90. USE_TZ = True
  91. LOGIN_REDIRECT_URL="display_map"
  92. # Phone number field option
  93. PHONENUMBER_DB_FORMAT = 'NATIONAL'
  94. PHONENUMBER_DEFAULT_REGION = 'FR'
  95. ## URL Prefixing
  96. URL_PREFIX=''
  97. # Static files (CSS, JavaScript, Images)
  98. # https://docs.djangoproject.com/en/1.9/howto/static-files/
  99. # STATIC_URL = '/{}assets/'.format(URL_PREFIX)
  100. # not defined here cause prefix overriding would not be taken into account
  101. STATICFILES_DIRS = [
  102. os.path.join(BASE_DIR, "static"),
  103. ]
  104. # Where to send notification after a point is added via the form.
  105. NOTIFICATION_EMAILS = []
  106. SITE_URL = 'http://example.com/wifi'