]> git.0d.be Git - chloro.git/blob - chloro/settings.py
do not include non-feed posts on homepage
[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 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
37
38 INSTALLED_APPS = [
39     'django.contrib.auth',
40     'django.contrib.contenttypes',
41     'django.contrib.sessions',
42     'django.contrib.messages',
43     'django.contrib.staticfiles',
44     'ckeditor',
45     'gadjo',
46     'sorl.thumbnail',
47     'taggit',
48     'chloro.phyll',
49 ]
50
51 MIDDLEWARE = [
52     'django.middleware.security.SecurityMiddleware',
53     'django.contrib.sessions.middleware.SessionMiddleware',
54     'django.middleware.common.CommonMiddleware',
55     'django.middleware.csrf.CsrfViewMiddleware',
56     'django.contrib.auth.middleware.AuthenticationMiddleware',
57     'django.contrib.messages.middleware.MessageMiddleware',
58     'django.middleware.clickjacking.XFrameOptionsMiddleware',
59 ]
60
61 ROOT_URLCONF = 'chloro.urls'
62
63 TEMPLATES = [
64     {
65         'BACKEND': 'django.template.backends.django.DjangoTemplates',
66         'DIRS': [],
67         'APP_DIRS': True,
68         'OPTIONS': {
69             'context_processors': [
70                 'django.template.context_processors.debug',
71                 'django.template.context_processors.request',
72                 'django.contrib.auth.context_processors.auth',
73                 'django.contrib.messages.context_processors.messages',
74             ],
75         },
76     },
77 ]
78
79 WSGI_APPLICATION = 'chloro.wsgi.application'
80
81
82 # Database
83 # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
84
85 DATABASES = {
86     'default': {
87         'ENGINE': 'django.db.backends.postgresql',
88         'NAME': 'chloro',
89     },
90 }
91
92
93 # Password validation
94 # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
95
96 AUTH_PASSWORD_VALIDATORS = [
97     {
98         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
99     },
100     {
101         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
102     },
103     {
104         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
105     },
106     {
107         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
108     },
109 ]
110
111 LOGIN_REDIRECT_URL = '/'
112 LOGIN_URL = 'login'
113
114 # Internationalization
115 # https://docs.djangoproject.com/en/1.11/topics/i18n/
116
117 LANGUAGE_CODE = 'fr-be'
118
119 TIME_ZONE = 'Europe/Brussels'
120
121 USE_I18N = True
122
123 USE_L10N = True
124
125 USE_TZ = True
126
127 LOCALE_PATHS = (os.path.join(BASE_DIR, 'chloro', 'locale'),)
128
129 # Static files (CSS, JavaScript, Images)
130 # https://docs.djangoproject.com/en/1.11/howto/static-files/
131 STATIC_ROOT = os.path.join(BASE_DIR, 'collected-static')
132 STATIC_URL = '/static/'
133 STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + ['gadjo.finders.XStaticFinder']
134
135 # Media files
136 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
137 MEDIA_URL = '/media/'
138
139 # ckeditor
140 CKEDITOR_UPLOAD_PATH = 'uploads/'
141 CKEDITOR_IMAGE_BACKEND = 'pillow'
142
143 CKEDITOR_CONFIGS = {
144     'default': {
145         'allowedContent': True,
146         'removePlugins': 'stylesheetparser',
147         'toolbar_Own': [
148             ['Source', 'Format', '-', 'Bold', 'Italic'],
149             ['NumberedList', 'BulletedList'],
150             ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
151             ['Link', 'Unlink'],
152             ['Image', '-', 'HorizontalRule'],
153             [
154                 'RemoveFormat',
155             ],
156             ['Maximize'],
157         ],
158         'toolbar': 'Own',
159         'resize_enabled': False,
160         'height': 500,
161     },
162 }
163
164 SITE_AUTHOR = 'Frédéric Péters'
165 SITE_TITLE = 'Coin web de Frédéric Péters'
166
167 local_settings_file = os.environ.get(
168     'CHLORO_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
169 )
170 if os.path.exists(local_settings_file):
171     exec(open(local_settings_file).read())
172
173 assert SECRET_KEY