· 7 years ago · Oct 08, 2018, 06:14 PM
1"""
2Django settings for huitcent project.
3
4Generated by 'django-admin startproject' using Django 1.9.1.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.9/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.9/ref/settings/
11"""
12
13import os
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17MEDIA_ROOT = "/srv/http/huitcent/huitcent/media/"
18STATIC_ROOT = "/srv/http/huitcent/huitcent/static/"
19
20# Quick-start development settings - unsuitable for production
21# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
22
23# SECURITY WARNING: keep the secret key used in production secret!
24SECRET_KEY = 'no-no-no'
25
26# SECURITY WARNING: don't run with debug turned on in production!
27DEBUG = True
28DEFAULT_FROM_EMAIL = "lavoie.michel@gmail.com"
29SESSION_EXPIRE_AT_BROWSER_CLOSE = True
30SESSION_COOKIE_AGE = 3600
31SITE_ID = 1
32
33ALLOWED_HOSTS = [
34 "huitcent.homeip.net",
35]
36
37# Application definition
38
39INSTALLED_APPS = [
40 'django.contrib.admin',
41 'django.contrib.auth',
42 'django.contrib.contenttypes',
43 'django.contrib.sessions',
44 'django.contrib.messages',
45 'django.contrib.staticfiles',
46 "forum",
47 "passwords",
48 "finance",
49]
50
51LOGIN_REDIRECT_URL = "/forum/"
52LOGIN_URL = "/login"
53LOGOUT_URL = "/logout"
54
55#MIDDLEWARE_CLASSES = [
56MIDDLEWARE = [
57 'django.middleware.security.SecurityMiddleware',
58 'django.contrib.sessions.middleware.SessionMiddleware',
59 'django.middleware.common.CommonMiddleware',
60 'django.middleware.csrf.CsrfViewMiddleware',
61 'django.contrib.auth.middleware.AuthenticationMiddleware',
62 'django.contrib.messages.middleware.MessageMiddleware',
63 'django.middleware.clickjacking.XFrameOptionsMiddleware',
64]
65
66ROOT_URLCONF = 'huitcent.urls'
67
68TEMPLATES = [
69 {
70 'BACKEND': 'django.template.backends.django.DjangoTemplates',
71 'DIRS': [
72 "/srv/http/huitcent/huitcent/huitcent/templates",
73 ],
74 'APP_DIRS': True,
75 'OPTIONS': {
76 'context_processors': [
77 'django.template.context_processors.debug',
78 'django.template.context_processors.request',
79 'django.contrib.auth.context_processors.auth',
80 'django.contrib.messages.context_processors.messages',
81 ],
82 },
83 },
84]
85
86WSGI_APPLICATION = 'huitcent.wsgi.application'
87
88ADMINS = (
89 ("Michel Lavoie", "lavoie.michel@gmail.com"),
90)
91
92MANAGERS = ADMINS
93
94# Database
95# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
96
97DATABASES = {
98 'default': {
99 'ENGINE': 'django.db.backends.sqlite3',
100 'NAME': os.path.join(BASE_DIR, 'sqlite3.db'),
101 }
102}
103
104
105# Password validation
106# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
107
108AUTH_PASSWORD_VALIDATORS = [
109 {
110 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
111 },
112 {
113 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
114 },
115 {
116 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
117 },
118 {
119 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
120 },
121]
122
123
124# Internationalization
125# https://docs.djangoproject.com/en/1.9/topics/i18n/
126
127LANGUAGE_CODE = 'fr-ca'
128
129TIME_ZONE = 'America/Montreal'
130
131USE_I18N = True
132
133USE_L10N = True
134
135USE_TZ = True
136
137
138# Static files (CSS, JavaScript, Images)
139# https://docs.djangoproject.com/en/1.9/howto/static-files/
140
141MEDIA_URL = "/media/"
142STATIC_URL = '/static/'