Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload files directly from Django admin to Amazon S3? Mitigating Heroku Application Error (timeout)

I have an app on Heroku (the free plan) and regularly get Application Error on media files uploads from Django admin. I use S3 for serving static&media. What is the best way to upload files to S3 directly via django admin? Or maybe there is some other way to mitigate this problem (withot adding dynos)?

like image 674
Pawel Ceranka Avatar asked Jul 04 '13 13:07

Pawel Ceranka


1 Answers

Try one of the following:

  1. s3 direct.: With s3 direct the file would be uploaded directly to s3.
  2. Increase Server Timeout You can increase your server timeout --- guessing you are using Gunicorn . Note that this could have repercussions, unfortunately I don't fully know what kind of repercussions
like image 116
acquayefrank Avatar answered Nov 15 '22 06:11

acquayefrank