1 # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 from sentry_sdk.integrations.django import DjangoIntegration
7 from .defaults import *
8 from ..localsettings import *
10 DATA_UPLOAD_MAX_MEMORY_SIZE = 20000000
12 PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
15 PROJECT_ROOT + '/static/'
20 'BACKEND': 'django.template.backends.django.DjangoTemplates',
23 PROJECT_ROOT + '/templates',
26 'context_processors': [
27 "django.contrib.auth.context_processors.auth",
28 "django.template.context_processors.debug",
29 "django.template.context_processors.i18n",
30 "redakcja.context_processors.settings", # this is instead of media
31 'django.template.context_processors.csrf',
32 "django.template.context_processors.request",
33 "django.contrib.messages.context_processors.messages",
40 'django.middleware.common.CommonMiddleware',
41 'django.middleware.csrf.CsrfViewMiddleware',
42 'django.contrib.sessions.middleware.SessionMiddleware',
43 'django.contrib.messages.middleware.MessageMiddleware',
45 'django.contrib.auth.middleware.AuthenticationMiddleware',
50 'django_cas_ng.middleware.CASMiddleware',
54 'django.contrib.admindocs.middleware.XViewMiddleware',
55 'fnp_django_pagination.middleware.PaginationMiddleware',
60 'debug_toolbar.middleware.DebugToolbarMiddleware',
64 AUTHENTICATION_BACKENDS = (
65 'django.contrib.auth.backends.ModelBackend',
66 'django_cas_ng.backends.CASBackend',
69 ROOT_URLCONF = 'redakcja.urls'
74 'django.contrib.auth',
75 'django.contrib.contenttypes',
76 'django.contrib.sessions',
77 'django.contrib.messages',
78 'django.contrib.staticfiles',
79 'django.contrib.sites',
80 'admin_numeric_filter',
81 'django.contrib.admin',
82 'django.contrib.admindocs',
85 'fnp_django_pagination',
107 'wlxml.apps.WlxmlConfig',
113 INSTALLED_APPS += ('debug_toolbar',)
116 PROJECT_ROOT + "/locale-contrib",
119 LOGIN_REDIRECT_URL = '/documents/user'
121 MIN_COVER_SIZE = (915, 1270)
123 LEGIMI_SMALL_WORDS = 2000
124 LEGIMI_BIG_WORDS = 10000
125 LEGIMI_SMALL_PRICE = 7
126 LEGIMI_BIG_PRICE = 20
128 THUMBNAIL_PRESERVE_FORMAT = True
130 STATICFILES_FINDERS = (
131 'django.contrib.staticfiles.finders.FileSystemFinder',
132 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
133 'pipeline.finders.PipelineFinder',
136 STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
139 'CSS_COMPRESSOR': None,
140 'JS_COMPRESSOR': None,
142 'libsasscompiler.LibSassCompiler',
145 # CSS and JS files to compress
148 'source_filenames': (
155 'css/imgareaselect-default.css',
158 'wiki/scss/splitter.scss',
159 'wiki/scss/visual.scss'
161 'output_filename': 'compressed/detail_styles.css',
164 'source_filenames': (
167 'output_filename': 'compressed/documents_styles.css',
170 'source_filenames': (
173 'output_filename': 'compressed/book.css',
176 'source_filenames': (
179 'output_filename': 'compressed/book_list.css',
183 # everything except codemirror
185 'source_filenames': (
187 'js/lib/jquery/jquery.blockui.js',
188 'js/lib/jquery/jquery.elastic.js',
189 'js/lib/jquery/jquery.xmlns.js',
190 'js/button_scripts.js',
195 'js/wiki/wikiapi.js',
201 'js/wiki/toolbar.js',
204 'js/wiki/dialog_save.js',
205 'js/wiki/dialog_revert.js',
206 'js/wiki/dialog_pubmark.js',
209 'js/wiki/view_sidebar.js',
210 'js/wiki/view_history.js',
211 'js/wiki/view_summary.js',
212 'js/wiki/view_editor_source.js',
213 'js/wiki/view_editor_wysiwyg.js',
214 'js/wiki/view_gallery.js',
215 'js/wiki/view_annotations.js',
216 'js/wiki/view_properties.js',
217 'js/wiki/view_search.js',
218 'js/wiki/view_column_diff.js',
220 'output_filename': 'compressed/detail_scripts.js',
223 'source_filenames': (
225 'js/lib/jquery/jquery.blockui.js',
226 'js/lib/jquery/jquery.elastic.js',
227 'js/lib/jquery/jquery.imgareaselect.js',
228 'js/button_scripts.js',
232 'js/wiki_img/wikiapi.js',
236 'js/wiki_img/base.js',
237 'js/wiki/toolbar.js',
240 'js/wiki/dialog_save.js',
241 'js/wiki/dialog_revert.js',
242 'js/wiki/dialog_pubmark.js',
245 'js/wiki_img/view_editor_objects.js',
246 'js/wiki_img/view_editor_motifs.js',
247 'js/wiki/view_editor_source.js',
248 'js/wiki/view_history.js',
249 'js/wiki/view_column_diff.js',
251 'output_filename': 'compressed/detail_img_scripts.js',
254 'source_filenames': (
255 'js/documents/documents.js',
257 'email_mangler/email_mangler.js',
259 'output_filename': 'compressed/documents_scripts.js',
262 'source_filenames': (
263 'js/lib/jquery/jquery.cycle2.min.js',
264 'js/book_text/jquery.eventdelegation.js',
265 'js/book_text/jquery.scrollto.js',
266 'js/book_text/jquery.highlightfade.js',
267 'js/book_text/book.js',
269 'output_filename': 'compressed/book.js',
272 'source_filenames': (
273 'js/documents/book_list.js',
275 'output_filename': 'compressed/book_list.js',
281 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
284 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
288 'DEFAULT_AUTHENTICATION_CLASSES': [
289 'rest_framework.authentication.SessionAuthentication',
290 'redakcja.api.auth.TokenAuthentication',
292 'DEFAULT_FILTER_BACKENDS': [
293 'django_filters.rest_framework.DjangoFilterBackend',
294 'rest_framework.filters.SearchFilter',
306 TEST_INTEGRATION = False
316 integrations=[DjangoIntegration()]