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 *
10 from ..localsettings import *
14 DATA_UPLOAD_MAX_MEMORY_SIZE = 20000000
16 PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
19 PROJECT_ROOT + '/static/'
24 'ENGINE': 'django.db.backends.postgresql',
26 'USER': os.environ.get('POSTGRES_USER'),
27 'PASSWORD': os.environ.get('POSTGRES_PASSWORD'),
28 'NAME': os.environ.get('POSTGRES_USER'),
34 'BACKEND': 'django.template.backends.django.DjangoTemplates',
37 PROJECT_ROOT + '/templates',
40 'context_processors': [
41 "django.contrib.auth.context_processors.auth",
42 "django.template.context_processors.debug",
43 "django.template.context_processors.i18n",
44 "redakcja.context_processors.settings", # this is instead of media
45 'django.template.context_processors.csrf',
46 "django.template.context_processors.request",
47 "django.contrib.messages.context_processors.messages",
54 'django.middleware.common.CommonMiddleware',
55 'django.middleware.csrf.CsrfViewMiddleware',
56 'django.contrib.sessions.middleware.SessionMiddleware',
57 'django.contrib.messages.middleware.MessageMiddleware',
59 'django.contrib.auth.middleware.AuthenticationMiddleware',
64 'django_cas_ng.middleware.CASMiddleware',
68 'django.contrib.admindocs.middleware.XViewMiddleware',
69 'fnp_django_pagination.middleware.PaginationMiddleware',
74 'debug_toolbar.middleware.DebugToolbarMiddleware',
78 AUTHENTICATION_BACKENDS = (
79 'django.contrib.auth.backends.ModelBackend',
80 'django_cas_ng.backends.CASBackend',
83 ROOT_URLCONF = 'redakcja.urls'
89 'django.contrib.auth',
90 'django.contrib.contenttypes',
91 'django.contrib.sessions',
92 'django.contrib.messages',
93 'django.contrib.staticfiles',
94 'django.contrib.sites',
95 'admin_numeric_filter',
96 'django.contrib.admin',
97 'django.contrib.admindocs',
100 'fnp_django_pagination',
122 'wlxml.apps.WlxmlConfig',
130 INSTALLED_APPS += ('debug_toolbar',)
133 PROJECT_ROOT + "/locale-contrib",
136 LOGIN_REDIRECT_URL = '/documents/user'
138 LEGIMI_SMALL_WORDS = 2000
139 LEGIMI_BIG_WORDS = 10000
140 LEGIMI_SMALL_PRICE = 7
141 LEGIMI_BIG_PRICE = 20
143 THUMBNAIL_PRESERVE_FORMAT = True
145 STATICFILES_FINDERS = (
146 'django.contrib.staticfiles.finders.FileSystemFinder',
147 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
148 'pipeline.finders.PipelineFinder',
151 STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
154 'CSS_COMPRESSOR': None,
155 'JS_COMPRESSOR': None,
157 'libsasscompiler.LibSassCompiler',
160 # CSS and JS files to compress
163 'source_filenames': (
170 'css/imgareaselect-default.css',
173 'wiki/scss/splitter.scss',
174 'wiki/scss/visual.scss'
176 'output_filename': 'compressed/detail_styles.css',
179 'source_filenames': (
182 'output_filename': 'compressed/documents_styles.css',
185 'source_filenames': (
188 'output_filename': 'compressed/book.css',
191 'source_filenames': (
194 'output_filename': 'compressed/book_list.css',
198 # everything except codemirror
200 'source_filenames': (
202 'js/lib/jquery/jquery.blockui.js',
203 'js/lib/jquery/jquery.elastic.js',
204 'js/lib/jquery/jquery.xmlns.js',
205 'js/button_scripts.js',
210 'js/wiki/wikiapi.js',
216 'js/wiki/toolbar.js',
221 'js/wiki/dialog_save.js',
222 'js/wiki/dialog_revert.js',
223 'js/wiki/dialog_pubmark.js',
226 'js/wiki/view_sidebar.js',
227 'js/wiki/view_history.js',
228 'js/wiki/view_summary.js',
229 'js/wiki/view_editor_source.js',
230 'js/wiki/view_editor_wysiwyg.js',
231 'js/wiki/view_gallery.js',
232 'js/wiki/view_annotations.js',
233 'js/wiki/view_properties.js',
234 'js/wiki/view_search.js',
235 'js/wiki/view_column_diff.js',
237 'output_filename': 'compressed/detail_scripts.js',
240 'source_filenames': (
242 'js/lib/jquery/jquery.blockui.js',
243 'js/lib/jquery/jquery.elastic.js',
244 'js/lib/jquery/jquery.imgareaselect.js',
245 'js/button_scripts.js',
249 'js/wiki_img/wikiapi.js',
253 'js/wiki_img/base.js',
254 'js/wiki/toolbar.js',
257 'js/wiki/dialog_save.js',
258 'js/wiki/dialog_revert.js',
259 'js/wiki/dialog_pubmark.js',
262 'js/wiki_img/view_editor_objects.js',
263 'js/wiki_img/view_editor_motifs.js',
264 'js/wiki/view_editor_source.js',
265 'js/wiki/view_history.js',
266 'js/wiki/view_column_diff.js',
268 'output_filename': 'compressed/detail_img_scripts.js',
271 'source_filenames': (
272 'js/documents/documents.js',
274 'email_mangler/email_mangler.js',
276 'output_filename': 'compressed/documents_scripts.js',
279 'source_filenames': (
280 'js/lib/jquery/jquery.cycle2.min.js',
281 'js/book_text/jquery.eventdelegation.js',
282 'js/book_text/jquery.scrollto.js',
283 'js/book_text/jquery.highlightfade.js',
284 'js/book_text/book.js',
286 'output_filename': 'compressed/book.js',
289 'source_filenames': (
290 'js/documents/book_list.js',
292 'output_filename': 'compressed/book_list.js',
298 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
301 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
305 'DEFAULT_AUTHENTICATION_CLASSES': [
306 'rest_framework.authentication.SessionAuthentication',
307 'redakcja.api.auth.TokenAuthentication',
309 'DEFAULT_FILTER_BACKENDS': [
310 'django_filters.rest_framework.DjangoFilterBackend',
311 'rest_framework.filters.SearchFilter',
323 TEST_INTEGRATION = False
333 integrations=[DjangoIntegration()]