For now i use django 1.11 and using google cloud platform (google storage) to store pdf.
my bucket is not open for public and everything was fine, but now i need to store public file (people with link can access uploaded pdf file)
I was thinking is it possible for me to have options(choose the bucket target) when upload to google storage?
Maybe something like this codes
from django.db import models
from storages.backends.s3boto import S3BotoStorage
class MyModel(models.Model):
file_1 = models.FileField() # Uses default storage
file_2 = models.FileField(storage=S3BotoStorage(bucket='other-bucket'))
I want to do the same as this, but using GCP instead of AWS django-storages with multiple S3 Buckets
I'm sorry if this question is too basic, but I've never found the answer until now
Thanks for your attention, and hope you can help me and the others who faced the same problem.
SOLVED Thanks to Thomas Plihibert
This codes worked well in my project
from django.db import models
from storages.backends.gcloud import GoogleCloudStorage
class MyModel(models.Model):
file_1 = models.FileField() # Uses default storage
file_2 = models.FileField(storage= GoogleCloudStorage(bucket_name='other-bucket'))
Hope this question useful for people who looking for the same case.