in Education by
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 like to include the stacktrace on my 500.html page when errors occur. By doing so, users can copy-and-paste the errors and easily email them to the developers. Any thoughts on how best to approach this issue? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Automatically log your 500s, that way: You know when they occur. You don't need to rely on users sending you stacktraces. Joel recommends even going so far as automatically creating tickets in your bug tracker when your application experiences a failure. Personally, I create a (private) RSS feed with the stacktraces, urls, etc. that the developers can subscribe to. Showing stack traces to your users on the other hand could possibly leak information that malicious users could use to attack your site. Overly detailed error messages are one of the classic stepping stones to SQL injection attacks. Edit (added code sample to capture traceback): You can get the exception information from the sys.exc_info call. While formatting the traceback for display comes from the traceback module: import traceback import sys try: raise Exception("Message") except: type, value, tb = sys.exc_info() print >> sys.stderr, type.__name__, ":", value print >> sys.stderr, '\n'.join(traceback.format_tb(tb)) Prints: Exception : Message File "exception.py", line 5, in raise Exception("Message")

Related questions

0 votes
    I am currently following along with a somewhat questionable Django tutorial called A complete blog engine using ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I am currently following along with a somewhat questionable Django tutorial called A complete blog engine using ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I am currently following along with a somewhat questionable Django tutorial called A complete blog engine using ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    How do you focus a particular part of the HTML page in JavaScript? (a) hover() (b) focus() (c ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    I live in your small intestine. Pseudocoelom is present in my thread like body. In which phylum ... ,Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    I have this grid: If I change the tables width from 100% to auto, table collapses horizontally. Which ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    Which HTML element is used to include images? (a) image (b) img (c) src (d) sourcing The ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    As the title says, why does my html template look different on three different screen sizes? I understand ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    In the Django model QuerySets, I see that there is a __gt and __lt for comparative values, but is there a __ne/!= ... (a=true, x__gt=5) Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    How do I do a not equal in Django queryset filtering?...
asked Feb 1, 2021 in Technology by JackTerrance
...