Third-Party Packages
django-custom-storage integrates with several third-party packages. This document provides information about these packages and their compatibility.
Required Dependencies
Django
Package: Django
Version: >= 3.2
Purpose: Django web framework
Links:
- PyPI
- Documentation
- GitHub
django-storages
Package: django-storages[s3]
Version: Latest stable
Purpose: Collection of custom storage backends for Django, including S3 backend
Links:
- PyPI
- Documentation
- GitHub
django-compressor
Package: django-compressor
Version: Latest stable
Purpose: Compresses linked and inline JavaScript or CSS into a single cached file
Links:
- PyPI
- Documentation
- GitHub
Note: django-compressor is required for StaticRootCachedS3Storage which uses CompressorFileStorage as the local storage backend.
boto3
Package: boto3
Version: Latest stable (installed as dependency of django-storages)
Purpose: AWS SDK for Python, used by django-storages for S3 integration
Links:
- PyPI
- Documentation
- GitHub
Optional Dependencies
Testing
These packages are included in the [testing] extra:
- pytest: Testing framework
- pytest-django: Django plugin for pytest
- coverage: Code coverage tool
- codecov: Code coverage reporting
Install with:
pip install django-custom-storage[testing]
Linting
These packages are included in the [linting] extra:
- flake8: Linter
- pylint: Code analyzer
Install with:
pip install django-custom-storage[linting]
Compatibility Matrix
| Package | Version | Django 3.2 | Django 4.2 | Django 5.2 |
|---|---|---|---|---|
| django-storages | Latest | ✅ | ✅ | ✅ |
| django-compressor | 4.4+ | ✅ | ✅ | ✅ |
| boto3 | Latest | ✅ | ✅ | ✅ |
Version Compatibility Notes
Django 3.2
- Uses
DEFAULT_FILE_STORAGEandSTATICFILES_STORAGEsettings get_storage_classis availableSTORAGESdictionary is not available by default
Django 4.2
- Introduces
STORAGESdictionary DEFAULT_FILE_STORAGEandSTATICFILES_STORAGEare deprecated but still workget_storage_classis available
Django 5.2
get_storage_classis removed- Uses
import_stringinstead (handled automatically by django-custom-storage) STORAGESdictionary is the recommended way to configure storage
django-compressor Compatibility
django-compressor is required for StaticRootCachedS3Storage. The storage class uses CompressorFileStorage as the local storage backend to:
- Cache compressed files locally
- Upload compressed files to S3
- Allow django-compressor to process files locally before uploading
If you don't use django-compressor, you can still use:
- MediaRootCachedS3Storage (uses FileSystemStorage locally)
- PublicMediaS3Boto3Storage (no local caching)
- PrivateMediaS3Boto3Storage (no local caching)
AWS S3 Compatibility
django-custom-storage works with any S3-compatible storage service, including:
- Amazon S3
- DigitalOcean Spaces
- MinIO
- Backblaze B2
- Any S3-compatible API
Configure using standard django-storages S3 settings.
Known Issues and Workarounds
django-compressor with Django 5.2
django-compressor may have compatibility issues with Django 5.2. The storage classes handle this by:
- Using
STORAGES["compressor"]["BACKEND"]which should be configured properly - Falling back gracefully if compressor is not available
boto3 Authentication
boto3 uses AWS credentials. Make sure to configure:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY- Or use AWS IAM roles (for EC2/ECS/Lambda)
See AWS S3 Configuration for more details.
Upgrading Dependencies
To upgrade dependencies:
-
Check the latest versions:
pip list --outdated -
Update requirements:
pip install --upgrade django-storages django-compressor boto3 -
Run tests to ensure compatibility:
python runtests.py -
Check for deprecation warnings:
python -W default manage.py check
Reporting Compatibility Issues
If you encounter compatibility issues with third-party packages:
- Check the package's documentation for known issues
- Check the package's GitHub issues
- Report the issue in django-custom-storage issues
- Include:
- Package versions
- Django version
- Python version
- Error traceback
- Steps to reproduce