Aucune description

settings.py.default 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. """
  2. Django settings for seum project.
  3. Generated by 'django-admin startproject' using Django 1.9.4.
  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. from django.core.urlresolvers import reverse_lazy
  11. from django.utils.translation import ugettext_lazy as _
  12. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  13. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  14. STATIC_ROOT = os.path.join(BASE_DIR, "static/")
  15. # Quick-start development settings - unsuitable for production
  16. # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
  17. # SECURITY WARNING: keep the secret key used in production secret!
  18. SECRET_KEY = '(#lovv#uky9unr9azzqy14gktpf0(d&+cp@++l95*y4e%m%_ex'
  19. # SECURITY WARNING: don't run with debug turned on in production!
  20. DEBUG = True
  21. # Application definition
  22. INSTALLED_APPS = [
  23. 'babel',
  24. 'graphos',
  25. 'bootstrap3',
  26. 'django.contrib.admin',
  27. 'django.contrib.auth',
  28. 'django.contrib.contenttypes',
  29. 'django.contrib.sessions',
  30. 'django.contrib.messages',
  31. 'django.contrib.staticfiles',
  32. 'django_extensions',
  33. 'counter'
  34. ]
  35. MIDDLEWARE_CLASSES = [
  36. 'django.middleware.security.SecurityMiddleware',
  37. 'django.contrib.sessions.middleware.SessionMiddleware',
  38. 'django.middleware.locale.LocaleMiddleware',
  39. 'django.middleware.common.CommonMiddleware',
  40. 'django.middleware.csrf.CsrfViewMiddleware',
  41. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  42. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  43. 'django.contrib.messages.middleware.MessageMiddleware',
  44. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  45. ]
  46. ROOT_URLCONF = 'seum.urls'
  47. TEMPLATES = [
  48. {
  49. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  50. 'DIRS': [],
  51. 'APP_DIRS': True,
  52. 'OPTIONS': {
  53. 'context_processors': [
  54. 'django.template.context_processors.debug',
  55. 'django.template.context_processors.request',
  56. 'django.contrib.auth.context_processors.auth',
  57. 'django.contrib.messages.context_processors.messages',
  58. ],
  59. },
  60. },
  61. ]
  62. WSGI_APPLICATION = 'seum.wsgi.application'
  63. # Database
  64. # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
  65. DATABASES = {
  66. 'default': {
  67. 'ENGINE': 'django.db.backends.sqlite3',
  68. 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  69. }
  70. }
  71. # Internationalization
  72. # https://docs.djangoproject.com/en/1.9/topics/i18n/
  73. LANGUAGE_CODE = 'en'
  74. TIME_ZONE = 'UTC'
  75. USE_I18N = True
  76. USE_L10N = True
  77. USE_TZ = True
  78. LANGUAGES = [
  79. ('en', _('English')),
  80. ('fr', _('French')),
  81. ]
  82. LOCALE_PATHS = [
  83. os.path.join(BASE_DIR, 'locale'),
  84. ]
  85. # Static files (CSS, JavaScript, Images)
  86. # https://docs.djangoproject.com/en/1.9/howto/static-files/
  87. STATIC_URL = '/static/'
  88. #Emailing
  89. EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  90. EMAIL_HOST = 'localhost'
  91. EMAIL_PORT = 25
  92. EMAIL_HOST_USER = ''
  93. EMAIL_HOST_PASSWORD = ''
  94. EMAIL_USE_TLS = False
  95. DEFAULT_FROM_EMAIL = 'SeumMan <seum@merigoux.ovh>'
  96. #Production settings
  97. SECURE_CONTENT_TYPE_NOSNIFF = True
  98. SECURE_BROWSER_XSS_FILTER = True
  99. SECURE_SSL_REDIRECT = True
  100. SESSION_COOKIE_SECURE = True
  101. CSRF_COOKIE_SECURE = True
  102. CSRF_COOKIE_HTTPONLY = True
  103. X_FRAME_OPTIONS = 'DENY'
  104. ALLOWED_HOSTS = ['seum.merigoux.ovh']
  105. #login
  106. LOGIN_URL = reverse_lazy('login')
  107. LOGIN_REDIRECT_URL = reverse_lazy('home')