Updates
[redakcja.git] / src / redakcja / settings / __init__.py
index b204d0a..cd60b49 100644 (file)
@@ -1,11 +1,15 @@
 # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
-import os.path
+import os
 import sentry_sdk
 from sentry_sdk.integrations.django import DjangoIntegration
 from .defaults import *
-from ..localsettings import *
+
+try:
+    from ..localsettings import *
+except ImportError:
+    pass
 
 DATA_UPLOAD_MAX_MEMORY_SIZE = 20000000
 
@@ -115,14 +119,14 @@ INSTALLED_APPS = (
 if DEBUG:
     INSTALLED_APPS += ('debug_toolbar',)
 
+FORMS_URLFIELD_ASSUME_HTTPS = True
+
 LOCALE_PATHS = [
     PROJECT_ROOT + "/locale-contrib",
 ]
 
 LOGIN_REDIRECT_URL = '/documents/user'
 
-MIN_COVER_SIZE = (915, 1270)
-
 LEGIMI_SMALL_WORDS = 2000
 LEGIMI_BIG_WORDS = 10000
 LEGIMI_SMALL_PRICE = 7
@@ -136,14 +140,24 @@ STATICFILES_FINDERS = (
     'pipeline.finders.PipelineFinder',
 )
 
-STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'
+STORAGES = {
+    'default': {
+        'BACKEND': 'django.core.files.storage.FileSystemStorage'
+    },
+    'staticfiles': {
+        'BACKEND': 'pipeline.storage.PipelineManifestStorage',
+    },
+}
 
 PIPELINE = {
-    'CSS_COMPRESSOR': None,
-    'JS_COMPRESSOR': None,
-    'COMPILERS': (
-        'libsasscompiler.LibSassCompiler',
-    ),
+    'JS_COMPRESSOR': 'pipeline.compressors.jsmin.JSMinCompressor',
+    'COMPILERS': ('pipeline.compilers.sass.SASSCompiler',),
+    'SASS_BINARY': '/opt/dart-sass/sass',
+    'SASS_ARGUMENTS': '--embed-source-map --embed-sources',
+    # Compress CSSwith a second run of dart-sass.
+    'CSS_COMPRESSOR': 'pipeline.compressors.cssmin.CSSMinCompressor',
+    'CSSMIN_BINARY': '/opt/dart-sass/sass',
+    'CSSMIN_ARGUMENTS': '--stdin --style=compressed --no-source-map',
 
     # CSS and JS files to compress
     'STYLESHEETS': {
@@ -286,7 +300,7 @@ PIPELINE = {
 DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
 
 
-SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
+SESSION_SERIALIZER = 'redakcja.serializer.JSONWithPickleFallbackSerializer'
 
 
 REST_FRAMEWORK = {
@@ -308,6 +322,8 @@ LANGUAGES = [
 ]
 
 
+USE_TZ = True
+
 TEST_INTEGRATION = False