Skip to content

Commit

Permalink
Specify Django storages according to newer requirements
Browse files Browse the repository at this point in the history
The old format was depreciated with Django 4.2.
  • Loading branch information
tomka committed Jan 22, 2025
1 parent 057fcb7 commit 9619195
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions django/projects/mysite/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,24 @@
},
}

# We use django-pipeline to compress and reference JavaScript and CSS files. To
# make Pipeline integrate with staticfiles (and therefore collecstatic calls)
# the STATICFILES_STORAGE variable has to be set to:
STATICFILES_STORAGE = 'pipeline.storage.PipelineManifestStorage'

# Adding PipelineFinder as asset discovery mechanism allows staticfiles to also
# discover files that were generated by Pipeline.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

STORAGES = {
'default': {
'BACKEND': 'django.core.files.storage.FileSystemStorage'
},
'staticfiles': {
# We use django-pipeline to compress and reference JavaScript and CSS files. To
# make Pipeline integrate with staticfiles (and therefore collecstatic calls)
# the STATICFILES_STORAGE variable has to be set to:
'BACKEND': 'pipeline.storage.PipelineManifestStorage',
},
}

PIPELINE = {
# Use CSSMin as django-pipeline's CSS compressor
'CSS_COMPRESSOR': 'pipeline.compressors.cssmin.CSSMinCompressor',
Expand Down

0 comments on commit 9619195

Please sign in to comment.