Description
Set up cloud file storage for inspection photos using django-storages.
Requirements
- django-storages with S3-compatible backend (works with AWS S3 and Cloudflare R2)
- Separate storage backends:
MediaStorage for user uploads (photos)
StaticStorage for static files (optional, can use default)
- Automatic thumbnail generation on upload (Pillow)
- Thumbnail size: 300x300 max, maintaining aspect ratio
- Signed URLs for private photo access (24h expiry)
- Local file storage fallback for development (
MEDIA_ROOT)
- Upload size limit: 10MB per photo
- Accepted formats: JPEG, PNG, HEIC (convert HEIC to JPEG on upload)
Configuration
# settings/base.py
STORAGES = {
"default": {"BACKEND": "storages.backends.s3boto3.S3Boto3Storage"},
"staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"},
}
Acceptance Criteria
Description
Set up cloud file storage for inspection photos using django-storages.
Requirements
MediaStoragefor user uploads (photos)StaticStoragefor static files (optional, can use default)MEDIA_ROOT)Configuration
Acceptance Criteria