Open veeral-patel opened 6 years ago
Hi,
you can make your own subclass of the GoogleCloudStorage
class to then set to DEFAULT_FILE_STORAGE
.
from storages.backends.gcloud import GoogleCloudStorage
from tenant_schemas.storage import TenantStorageMixin
class TenantGoogleCloudStorage(TenantStorageMixin, GoogleCloudStorage):
pass
And then set
DEFAULT_FILE_STORAGE = 'path.to.storage.TenantGoogleCloudStorage'
Thank you @mikicz! I'll try this out! Feel free to close.
Maybe add this somewhere in the docs, as it really sounds quite useful. Maybe also another example for settings cookies/session/cache storage?
Hi all!
So I want to use
django-storages
to store my static and media files in a Google Cloud Storage bucket.Currently, I have this line in my
settings.py
:I understand I need to add
TenantStorageMixin
to thisGoogleCloudStorage
backend. Is there an easy way of doing this without modifying my localdjango-storages
code to make it inherit fromTenantStorageMixin
as well?I do need to use Google Cloud Storage, but I don't need to use
django-storages
. So if you have an alternative backend for storing tenant data withdjango-tenant-schemas
, please let me know too!