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',
112 INSTALLED_APPS += ('debug_toolbar',)
115 PROJECT_ROOT + "/locale-contrib",
118 LOGIN_REDIRECT_URL = '/documents/user'
120 MIN_COVER_SIZE = (915, 1270)
122 LEGIMI_SMALL_WORDS = 2000
123 LEGIMI_BIG_WORDS = 10000
124 LEGIMI_SMALL_PRICE = 7
125 LEGIMI_BIG_PRICE = 20
127 STATICFILES_FINDERS = (
128 'django.contrib.staticfiles.finders.FileSystemFinder',
129 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
130 'pipeline.finders.PipelineFinder',
133 STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
136 'CSS_COMPRESSOR': None,
137 'JS_COMPRESSOR': None,
139 'pipeline.compilers.sass.SASSCompiler',
142 # CSS and JS files to compress
145 'source_filenames': (
152 'css/imgareaselect-default.css',
155 'wiki/scss/splitter.scss',
156 'wiki/scss/visual.scss'
158 'output_filename': 'compressed/detail_styles.css',
161 'source_filenames': (
164 'output_filename': 'compressed/documents_styles.css',
167 'source_filenames': (
170 'output_filename': 'compressed/book.css',
173 'source_filenames': (
176 'output_filename': 'compressed/book_list.css',
180 # everything except codemirror
182 'source_filenames': (
184 'js/lib/jquery/jquery.blockui.js',
185 'js/lib/jquery/jquery.elastic.js',
186 'js/lib/jquery/jquery.xmlns.js',
187 'js/button_scripts.js',
192 'js/wiki/wikiapi.js',
198 'wiki/js/sidebar-perspective.js',
199 'js/wiki/toolbar.js',
202 'js/wiki/dialog_save.js',
203 'js/wiki/dialog_revert.js',
204 'js/wiki/dialog_pubmark.js',
207 'js/wiki/view_history.js',
208 'js/wiki/view_summary.js',
209 'js/wiki/view_editor_source.js',
210 'js/wiki/view_editor_wysiwyg.js',
211 'js/wiki/view_gallery.js',
212 'js/wiki/view_annotations.js',
213 'js/wiki/view_properties.js',
214 'js/wiki/view_search.js',
215 'js/wiki/view_column_diff.js',
217 'output_filename': 'compressed/detail_scripts.js',
220 'source_filenames': (
222 'js/lib/jquery/jquery.blockui.js',
223 'js/lib/jquery/jquery.elastic.js',
224 'js/lib/jquery/jquery.imgareaselect.js',
225 'js/button_scripts.js',
229 'js/wiki_img/wikiapi.js',
233 'js/wiki_img/base.js',
234 'js/wiki/toolbar.js',
237 'js/wiki/dialog_save.js',
238 'js/wiki/dialog_revert.js',
239 'js/wiki/dialog_pubmark.js',
242 'js/wiki_img/view_editor_objects.js',
243 'js/wiki_img/view_editor_motifs.js',
244 'js/wiki/view_editor_source.js',
245 'js/wiki/view_history.js',
246 'js/wiki/view_column_diff.js',
248 'output_filename': 'compressed/detail_img_scripts.js',
251 'source_filenames': (
252 'js/documents/documents.js',
254 'email_mangler/email_mangler.js',
256 'output_filename': 'compressed/documents_scripts.js',
259 'source_filenames': (
260 'js/lib/jquery/jquery.cycle2.min.js',
261 'js/book_text/jquery.eventdelegation.js',
262 'js/book_text/jquery.scrollto.js',
263 'js/book_text/jquery.highlightfade.js',
264 'js/book_text/book.js',
266 'output_filename': 'compressed/book.js',
269 'source_filenames': (
270 'js/documents/book_list.js',
272 'output_filename': 'compressed/book_list.js',
278 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
281 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
285 'DEFAULT_AUTHENTICATION_CLASSES': [
286 'rest_framework.authentication.SessionAuthentication',
287 'redakcja.api.auth.TokenAuthentication',
289 'DEFAULT_FILTER_BACKENDS': [
290 'django_filters.rest_framework.DjangoFilterBackend',
291 'rest_framework.filters.SearchFilter',
303 TEST_INTEGRATION = False
313 integrations=[DjangoIntegration()]