diff --git a/.gitignore b/.gitignore index 6769e21..cea956f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Compressed / cached static files +src/static/CACHE/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/requirements.txt b/requirements.txt index 8718701..e0b4209 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/src/Results/settings.py b/src/Results/settings.py index 744bb10..7a65f19 100644 --- a/src/Results/settings.py +++ b/src/Results/settings.py @@ -42,6 +42,7 @@ INSTALLED_APPS = [ # 'rest_framework_datatables' 'mainapp', 'baton.autodiscover', + 'compressor', ] MIDDLEWARE = [ @@ -122,6 +123,16 @@ USE_TZ = True STATIC_URL = 'static/' STATICFILES_DIRS = [BASE_DIR / 'static/'] +STATICFILES_FINDERS = ["compressor.finders.CompressorFinder"] + +# Compressors + +COMPRESS_OFFLINE = True +LIBSASS_OUTPUT_STYLE = "compressed" +COMPRESS_PRECOMPILERS = ( + ("text/x-scss", "django_libsass.SassCompiler"), +) +COMPRESS_ROOT = BASE_DIR / 'static/' # Default primary key field type # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field