]> git.0d.be Git - chloro.git/blob - chloro/settings.py
a3f3e44d6493da73bedf35183b0965552954667a
[chloro.git] / chloro / settings.py
1 """
2 Django settings for chloro project.
3
4 Generated by 'django-admin startproject' using Django 1.11.17.
5
6 For more information on this file, see
7 https://docs.djangoproject.com/en/1.11/topics/settings/
8
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/1.11/ref/settings/
11 """
12
13 import copy
14 import os
15
16 from django.conf import global_settings
17
18 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
19 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
20
21
22 # Quick-start development settings - unsuitable for production
23 # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
24
25 # SECURITY WARNING: keep the secret key used in production secret!
26 SECRET_KEY = ''
27
28 # SECURITY WARNING: don't run with debug turned on in production!
29 DEBUG = True
30
31 ALLOWED_HOSTS = []
32
33
34 # Application definition
35
36 INSTALLED_APPS = [
37     'django.contrib.auth',
38     'django.contrib.contenttypes',
39     'django.contrib.sessions',
40     'django.contrib.messages',
41     'django.contrib.staticfiles',
42     'ckeditor',
43     'gadjo',
44     'sorl.thumbnail',
45     'taggit',
46     'chloro.phyll',
47 ]
48
49 MIDDLEWARE = [
50     'django.middleware.security.SecurityMiddleware',
51     'django.contrib.sessions.middleware.SessionMiddleware',
52     'django.middleware.common.CommonMiddleware',
53     'django.middleware.csrf.CsrfViewMiddleware',
54     'django.contrib.auth.middleware.AuthenticationMiddleware',
55     'django.contrib.messages.middleware.MessageMiddleware',
56     'django.middleware.clickjacking.XFrameOptionsMiddleware',
57 ]
58
59 ROOT_URLCONF = 'chloro.urls'
60
61 TEMPLATES = [
62     {
63         'BACKEND': 'django.template.backends.django.DjangoTemplates',
64         'DIRS': [],
65         'APP_DIRS': True,
66         'OPTIONS': {
67             'context_processors': [
68                 'django.template.context_processors.debug',
69                 'django.template.context_processors.request',
70                 'django.contrib.auth.context_processors.auth',
71                 'django.contrib.messages.context_processors.messages',
72             ],
73         },
74     },
75 ]
76
77 WSGI_APPLICATION = 'chloro.wsgi.application'
78
79
80 # Database
81 # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
82
83 DATABASES = {
84     'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'chloro',},
85 }
86
87
88 # Password validation
89 # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
90
91 AUTH_PASSWORD_VALIDATORS = [
92     {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',},
93     {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',},
94     {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',},
95     {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',},
96 ]
97
98 LOGIN_REDIRECT_URL = '/'
99 LOGIN_URL = 'login'
100
101 # Internationalization
102 # https://docs.djangoproject.com/en/1.11/topics/i18n/
103
104 LANGUAGE_CODE = 'fr-be'
105
106 TIME_ZONE = 'Europe/Brussels'
107
108 USE_I18N = True
109
110 USE_L10N = True
111
112 USE_TZ = True
113
114
115 # Static files (CSS, JavaScript, Images)
116 # https://docs.djangoproject.com/en/1.11/howto/static-files/
117 STATIC_ROOT = os.path.join(BASE_DIR, 'collected-static')
118 STATIC_URL = '/static/'
119 STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + ['gadjo.finders.XStaticFinder']
120
121 # Media files
122 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
123 MEDIA_URL = '/media/'
124
125 # ckeditor
126 CKEDITOR_UPLOAD_PATH = 'uploads/'
127 CKEDITOR_IMAGE_BACKEND = 'pillow'
128
129 CKEDITOR_CONFIGS = {
130     'default': {
131         'allowedContent': True,
132         'removePlugins': 'stylesheetparser',
133         'toolbar_Own': [
134             ['Source', 'Format', '-', 'Bold', 'Italic'],
135             ['NumberedList', 'BulletedList'],
136             ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
137             ['Link', 'Unlink'],
138             ['Image', '-', 'HorizontalRule'],
139             ['RemoveFormat',],
140             ['Maximize'],
141         ],
142         'toolbar': 'Own',
143         'resize_enabled': False,
144         'height': 500,
145     },
146 }
147
148 SITE_AUTHOR = "Frédéric Péters"
149 SITE_TITLE = "Coin web de Frédéric Péters"
150
151 local_settings_file = os.environ.get(
152     'CHLORO_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
153 )
154 if os.path.exists(local_settings_file):
155     exec(open(local_settings_file).read())
156
157 assert SECRET_KEY