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)?
Asked
Active
Viewed 1,064 times
4 Answers
1
Try one of the following:
- s3 direct.: With s3 direct the file would be uploaded directly to s3.
- 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

acquayefrank
- 474
- 5
- 21
0
You can use django-storages for this

joel.d
- 1,611
- 16
- 21
-
1How does that help? The problem occurs if file upload through admin takes more than 30 seconds. Then we run into the heroku timeout. – Andreas Dolk Aug 14 '14 at 14:55
0
@acquayefrank's suggestion worked for me. I have a Django project and I was having trouble uploading about 120 MB+ files through the Django Admin.
I changed my Procfile to say this (replace yourname
with the dotted path to your .wsgi):
web: gunicorn --timeout 120 yourname.wsgi --log-file -
I can't say for certain that this will solve everyone's same issue but might be worth a try.

Jarad
- 17,409
- 19
- 95
- 154
0
This article outlines how you can upload directly to S3 with the assistance of Javascript. You could then potentially use custom Javascript in the Django admin to achieve the same outcome. Hope it helps.

Daniel Holmes
- 1,952
- 2
- 17
- 28