Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper Way to Deploy Django/Static Files on Heroku

I am currently working on a Django application, and planning to deploy with Heroku and gunicorn. I've been reading some documentation, and I'm a little confused over proper method to use either nginx or Amazon S3 to support static files and take Django off debug mode.

  1. If I use Nginx with gunicorn, are all static files stored on Heroku, and if so, how do I handle user uploaded files given limited storage on Heroku?

  2. If I use S3 to host my static files, does the application still necessitate the use of nginx, or would I still need it for security purposes? What would you recommend?

I've been searching for a tutorial involving Heroku and nginx, but haven't been able to find any so far. Thanks in advance.

like image 793
zhuyxn Avatar asked Apr 01 '13 23:04

zhuyxn


1 Answers

If you're deploying to Heroku you likely don't need to mess with anything nginx. See this guide on

  • Django and Static Assets.
  • https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/

See also

  • https://devcenter.heroku.com/articles/s3
like image 117
catsby Avatar answered Oct 31 '22 07:10

catsby