简体   繁体   中英

Django + Heroku - Debug = False issues

I've been working on a website for a while now (Django/Python on Heroku). I usually have debug = true while developing, but now when I set to false I get 'application errors' from Heroku. My logs inform me that the issue is a "Request Interrupted" (H18, sock=backend).

I understand that this means that I have an error somewhere in my code, but for the life of me I cannot figure out where.

I'm also having a hard time finding an efficient debugging work-flow when Debug=False. I have logentries and NewRelic for error monitoring on the Heroku app, but NewRelic reports 0 errors while logentries only gives me the default heroku-app error logs.

I cannot possibly show you all my code (also I won't), so I realize that it'll be difficult for anyone to pinpoint my exact problem - therefore I am more asking in general terms.

I know that all URLs need to end with a slash, and that the ALLOWED_HOSTS setting is required - but what else can result in these errors when debug = false ?

Oh please note that EVERYTHING works as intended when debug is true.

I'm running Django version 1.7 with Python version 2.7.6.

These are the 3rd party apps that I use:

  • Grappelli (loaded before default Django apps)
  • gunicorn
  • storages
  • compressor
  • collectfast
  • haystack
  • bootstrap3
  • robots
  • sorl.thumbnail
  • django_countries
  • django_wysiwyg
  • validatedfile
  • colorfield
  • cookielaw

So I apparently discovered the culprit. I was also using django-htmlmin , and for whatever weird reason that apparently caused my issues. I removed it and everything worked fine regardless of the debug setting. Yay!

I don't have the insight to say why django-htmlmin was causing these issues, although I suspect it might be incompatible with Django 1.7 or Django-Compresser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM