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-compressor to project dependencies in pyproject.toml
  • Configured compressor in example_project/settings.py: Added compressor to INSTALLED_APPS Added CompressorFinder to STATICFILES_FINDERS Configured COMPRESS_PRECOMPILERS for SCSS/Sass support
  • Updated base.html to wrap CSS and JS assets inside {% compress %} template blocks
  • Added tests/test_compression.py with 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

Merge request reports

Loading