Django-storages save() problem

Issue #224 new
David Suilea
created an issue
form = Form(request.POST, request.FILES)

if form.is_valid():
   new_file =                                                                           
   new_file.client = client

   if client.location == "US": = S3BotoStorage(bucket="us")

   # Here is us
   # Here is eu

What I'm trying to do : I'm trying, at runtime, to decide if I'm gonna use the default bucket or the us bucket to save a file in. Using : django storages + boto and amazon aws s3

Extra information : I have a default AWS_STORAGE_BUCKET_NAME set to eu

Problem encountered : If I try to save the file on the us server, the file gets saved on the us bucket but the file gets saved in the database with the default bucket value, so when I try to load the file, it tries to get the file from the eu bucket. As seen on line 12 and 14, it seems that the save method overwrites the value that I provide in line 10

Comments (0)

  1. Log in to comment