SCSS Support in Django

This commit is contained in:
Corban-Lee 2023-10-21 21:32:00 +01:00
parent 78b9cae0ab
commit 4c09b8470d
3 changed files with 14 additions and 0 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# Compressed / cached static files
src/static/CACHE/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

Binary file not shown.

View File

@ -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