]> 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 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': {
85         'ENGINE': 'django.db.backends.postgresql_psycopg2',
86         'NAME': 'chloro',
87     },
88 }
89
90
91 # Password validation
92 # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
93
94 AUTH_PASSWORD_VALIDATORS = [
95     {
96         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
97     },
98     {
99         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
100     },
101     {
102         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
103     },
104     {
105         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
106     },
107 ]
108
109 LOGIN_REDIRECT_URL = '/'
110 LOGIN_URL = 'login'
111
112 # Internationalization
113 # https://docs.djangoproject.com/en/1.11/topics/i18n/
114
115 LANGUAGE_CODE = 'fr-be'
116
117 TIME_ZONE = 'Europe/Brussels'
118
119 USE_I18N = True
120
121 USE_L10N = True
122
123 USE_TZ = True
124
125
126 # Static files (CSS, JavaScript, Images)
127 # https://docs.djangoproject.com/en/1.11/howto/static-files/
128 STATIC_ROOT = os.path.join(BASE_DIR, 'collected-static')
129 STATIC_URL = '/static/'
130 STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + ['gadjo.finders.XStaticFinder']
131
132 # Media files
133 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
134 MEDIA_URL = '/media/'
135
136 # ckeditor
137 CKEDITOR_UPLOAD_PATH = 'uploads/'
138 CKEDITOR_IMAGE_BACKEND = 'pillow'
139
140 CKEDITOR_CONFIGS = {
141     'default': {
142         'allowedContent': True,
143         'removePlugins': 'stylesheetparser',
144         'toolbar_Own': [
145             ['Source', 'Format', '-', 'Bold', 'Italic'],
146             ['NumberedList', 'BulletedList'],
147             ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
148             ['Link', 'Unlink'],
149             ['Image', '-', 'HorizontalRule'],
150             [
151                 'RemoveFormat',
152             ],
153             ['Maximize'],
154         ],
155         'toolbar': 'Own',
156         'resize_enabled': False,
157         'height': 500,
158     },
159 }
160
161 SITE_AUTHOR = "Frédéric Péters"
162 SITE_TITLE = "Coin web de Frédéric Péters"
163
164 local_settings_file = os.environ.get(
165     'CHLORO_SETTINGS_FILE', os.path.join(os.path.dirname(__file__), 'local_settings.py')
166 )
167 if os.path.exists(local_settings_file):
168     exec(open(local_settings_file).read())
169
170 assert SECRET_KEY