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 MIN_COVER_SIZE = (915, 1270)
140 LEGIMI_SMALL_WORDS = 2000
141 LEGIMI_BIG_WORDS = 10000
142 LEGIMI_SMALL_PRICE = 7
143 LEGIMI_BIG_PRICE = 20
145 THUMBNAIL_PRESERVE_FORMAT = True
147 STATICFILES_FINDERS = (
148 'django.contrib.staticfiles.finders.FileSystemFinder',
149 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
150 'pipeline.finders.PipelineFinder',
153 STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
156 'CSS_COMPRESSOR': None,
157 'JS_COMPRESSOR': None,
159 'libsasscompiler.LibSassCompiler',
162 # CSS and JS files to compress
165 'source_filenames': (
172 'css/imgareaselect-default.css',
175 'wiki/scss/splitter.scss',
176 'wiki/scss/visual.scss'
178 'output_filename': 'compressed/detail_styles.css',
181 'source_filenames': (
184 'output_filename': 'compressed/documents_styles.css',
187 'source_filenames': (
190 'output_filename': 'compressed/book.css',
193 'source_filenames': (
196 'output_filename': 'compressed/book_list.css',
200 # everything except codemirror
202 'source_filenames': (
204 'js/lib/jquery/jquery.blockui.js',
205 'js/lib/jquery/jquery.elastic.js',
206 'js/lib/jquery/jquery.xmlns.js',
207 'js/button_scripts.js',
212 'js/wiki/wikiapi.js',
218 'js/wiki/toolbar.js',
223 'js/wiki/dialog_save.js',
224 'js/wiki/dialog_revert.js',
225 'js/wiki/dialog_pubmark.js',
228 'js/wiki/view_sidebar.js',
229 'js/wiki/view_history.js',
230 'js/wiki/view_summary.js',
231 'js/wiki/view_editor_source.js',
232 'js/wiki/view_editor_wysiwyg.js',
233 'js/wiki/view_gallery.js',
234 'js/wiki/view_annotations.js',
235 'js/wiki/view_properties.js',
236 'js/wiki/view_search.js',
237 'js/wiki/view_column_diff.js',
239 'output_filename': 'compressed/detail_scripts.js',
242 'source_filenames': (
244 'js/lib/jquery/jquery.blockui.js',
245 'js/lib/jquery/jquery.elastic.js',
246 'js/lib/jquery/jquery.imgareaselect.js',
247 'js/button_scripts.js',
251 'js/wiki_img/wikiapi.js',
255 'js/wiki_img/base.js',
256 'js/wiki/toolbar.js',
259 'js/wiki/dialog_save.js',
260 'js/wiki/dialog_revert.js',
261 'js/wiki/dialog_pubmark.js',
264 'js/wiki_img/view_editor_objects.js',
265 'js/wiki_img/view_editor_motifs.js',
266 'js/wiki/view_editor_source.js',
267 'js/wiki/view_history.js',
268 'js/wiki/view_column_diff.js',
270 'output_filename': 'compressed/detail_img_scripts.js',
273 'source_filenames': (
274 'js/documents/documents.js',
276 'email_mangler/email_mangler.js',
278 'output_filename': 'compressed/documents_scripts.js',
281 'source_filenames': (
282 'js/lib/jquery/jquery.cycle2.min.js',
283 'js/book_text/jquery.eventdelegation.js',
284 'js/book_text/jquery.scrollto.js',
285 'js/book_text/jquery.highlightfade.js',
286 'js/book_text/book.js',
288 'output_filename': 'compressed/book.js',
291 'source_filenames': (
292 'js/documents/book_list.js',
294 'output_filename': 'compressed/book_list.js',
300 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
303 SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
307 'DEFAULT_AUTHENTICATION_CLASSES': [
308 'rest_framework.authentication.SessionAuthentication',
309 'redakcja.api.auth.TokenAuthentication',
311 'DEFAULT_FILTER_BACKENDS': [
312 'django_filters.rest_framework.DjangoFilterBackend',
313 'rest_framework.filters.SearchFilter',
325 TEST_INTEGRATION = False
335 integrations=[DjangoIntegration()]