introduce django compressor
This commit is contained in:
parent
67e1b4cab1
commit
a4a0fa4f8b
7 changed files with 121 additions and 2 deletions
|
@ -76,6 +76,7 @@ INSTALLED_APPS = [
|
|||
"django.contrib.staticfiles",
|
||||
"django.contrib.sitemaps",
|
||||
# 3rd party
|
||||
"compressor",
|
||||
"django_prose_editor",
|
||||
"rest_framework",
|
||||
"schema_viewer",
|
||||
|
@ -186,6 +187,25 @@ USE_TZ = True
|
|||
STATIC_URL = "static/"
|
||||
STATIC_ROOT = env.path("STATIC_ROOT", default=BASE_DIR / "static")
|
||||
|
||||
# Static files configuration
|
||||
STATICFILES_FINDERS = [
|
||||
"django.contrib.staticfiles.finders.FileSystemFinder",
|
||||
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
||||
"compressor.finders.CompressorFinder",
|
||||
]
|
||||
|
||||
# Django Compressor settings
|
||||
COMPRESS_ENABLED = True
|
||||
COMPRESS_OFFLINE = True # Compress during build, not runtime
|
||||
COMPRESS_CSS_FILTERS = [
|
||||
"compressor.filters.css_default.CssAbsoluteFilter",
|
||||
"compressor.filters.cssmin.rCSSMinFilter",
|
||||
]
|
||||
COMPRESS_JS_FILTERS = [
|
||||
"compressor.filters.jsmin.rJSMinFilter",
|
||||
]
|
||||
COMPRESS_OUTPUT_DIR = "CACHE"
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue