Add django-compressor integration #635
Summary
Postorius currently does not use django-compressor, while HyperKitty already integrates it.
This merge request adds django-compressor integration to Postorius so that all .js and .css assets are bundled and compressed before being served.
This reduces the number of HTTP requests and decreases data transfer between the client and server, improving performance.
Fixes #635
Changes
- Added
django-compressorto project dependencies inpyproject.toml - Configured compressor in
example_project/settings.py: AddedcompressortoINSTALLED_APPSAddedCompressorFindertoSTATICFILES_FINDERSConfiguredCOMPRESS_PRECOMPILERSfor SCSS/Sass support - Updated
base.htmlto wrap CSS and JS assets inside{% compress %}template blocks - Added
tests/test_compression.pywith 5 tests to verify: Compressor is properly configured Static files are bundled Integration works without breaking existing functionality
Testing
Installed django-compressor
Ran migrations and collected static files
Verified that compressed CSS and JS files are generated correctly
Confirmed the application loads assets without errors
All tests pass successfully