How do I include a stacktrace in my Django 500.html page?

前端 未结 5 961
孤街浪徒
孤街浪徒 2020-12-29 05:28

I\'m running Django 1.0 and I\'m close to deploying my app. As such, I\'ll be changing the DEBUG setting to False.

With that being said, I\'d still lik

5条回答
  •  梦谈多话
    2020-12-29 05:57

    As @zacherates says, you really don't want to display a stacktrace to your users. The easiest approach to this problem is what Django does by default if you have yourself and your developers listed in the ADMINS setting with email addresses; it sends an email to everyone in that list with the full stack trace (and more) everytime there is a 500 error with DEBUG = False.

提交回复
热议问题