0

Any ideas what can go wrong that would cause a Gunicorn not be able to serve a link to a pdf file when DEBUG in django settings.py is turned to False? The site still works great but pdf links are not served.

When DEBUG=True the site with links to pdf files works great and gunicorn serves pdf links and pdf shows on screen, whereas when DEBUG=False and ALLOWED_HOSTS = ['my provider's IP'] (all other configurations in settings.py are the same) and gunicorn.conf is untouched in both situations, pdf links fail.

pebox11
  • 3,377
  • 5
  • 32
  • 57
  • Is it static? Or not? – sobolevn Nov 03 '15 at 20:07
  • Well, the pdf link is created by a user upload. In this sense it is not static. – pebox11 Nov 03 '15 at 21:33
  • ok, i assume that it is a media file then. what are your media-settings? – sobolevn Nov 03 '15 at 21:34
  • /site_media/static is doing great and all .js etc load and appear on screen when selected by the browser debugger – pebox11 Nov 03 '15 at 22:09
  • 1
    but your media files are not the same as static: http://stackoverflow.com/questions/5016589/what-is-the-difference-between-static-files-and-media-files-in-django – sobolevn Nov 04 '15 at 08:52
  • You are correct. It had to do with user privileges on the media files folder. Btw do you know of any good strategy to backup media files (that users upload etc?). Thank you very much. I gave you a thumbs up! – pebox11 Nov 06 '15 at 16:08
  • 1
    I have used this library several years ago: https://github.com/django-dbbackup/django-dbbackup – sobolevn Nov 06 '15 at 19:44

0 Answers0