theriverman / django-minio-backend

Minio Backend for Django
https://pypi.org/project/django-minio-backend/
MIT License
111 stars 22 forks source link

How to have multiple MINIO_MEDIA_FILES_BUCKET? #43

Closed dev-msln closed 1 year ago

dev-msln commented 1 year ago

Based on my needs, I divided media files into 2 separate buckets. One is private and another is public. the problem is that, the django only can serve one of the buckets at a time. Here is my settings:

MINIO_PRIVATE_BUCKET = "private-bk"
MINIO_PUBLIC_BUCKET = "public-bk"
DEFAULT_FILE_STORAGE = "django_minio_backend.models.MinioBackend"
MINIO_MEDIA_FILES_BUCKET = MINIO_PUBLIC_BUCKET  # replacement for MEDIA_ROOT
MINIO_PRIVATE_BUCKETS = [MINIO_PRIVATE_BUCKET]
MINIO_PUBLIC_BUCKETS = [MINIO_PUBLIC_BUCKET]

Now in the production, links for the public bucket files are generated (static links) and links work. but links for private bucket files don't work (they are permanent links) Is it possible to have multiple buckets as MINIO_MEDIA_FILES_BUCKET?

dev-msln commented 1 year ago

Issue Solved. It was due to Nginx (reverse proxy) configs.