Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions interview_service/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"storages",
# Local apps
"accounts",
"interviewers",
Expand Down
5 changes: 4 additions & 1 deletion interview_service/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@
MIDDLEWARE += ["django_browser_reload.middleware.BrowserReloadMiddleware"] # noqa: F405

# Use local file storage in development
DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage"
STORAGES = {
"default": {"BACKEND": "django.core.files.storage.FileSystemStorage"},
"staticfiles": {"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"},
}
6 changes: 4 additions & 2 deletions interview_service/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@

# WhiteNoise for static files
MIDDLEWARE.insert(1, "whitenoise.middleware.WhiteNoiseMiddleware") # noqa: F405
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"

# MinIO / S3 storage for media files
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
STORAGES = {
"default": {"BACKEND": "storages.backends.s3boto3.S3Boto3Storage"},
"staticfiles": {"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage"},
}
Comment on lines +33 to +36

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With S3Boto3Storage as the default storage, FieldFile.url will be built from the S3 endpoint unless AWS_S3_CUSTOM_DOMAIN is configured. If MINIO_ENDPOINT_URL is set to an internal Docker hostname (e.g. http://minio:9000) or uses plain HTTP, production pages will render image URLs that are unreachable from the browser and/or blocked as mixed content. Consider configuring a public HTTPS-facing domain for media (via AWS_S3_CUSTOM_DOMAIN and related settings) or ensure MINIO_ENDPOINT_URL points to a publicly reachable HTTPS endpoint for URL generation.

Copilot uses AI. Check for mistakes.
AWS_ACCESS_KEY_ID = os.environ.get("MINIO_ACCESS_KEY")
AWS_SECRET_ACCESS_KEY = os.environ.get("MINIO_SECRET_KEY")
AWS_STORAGE_BUCKET_NAME = os.environ.get("MINIO_BUCKET_NAME", "interview-service")
Expand Down
Loading