#21345: Debug view calls callable settings
----------------------------------------+------------------------
               Reporter:  aaugustin     |          Owner:  nobody
                   Type:  Bug           |         Status:  new
              Component:  Core (Other)  |        Version:  master
               Severity:  Normal        |       Keywords:
           Triage Stage:  Unreviewed    |      Has patch:  0
    Needs documentation:  0             |    Needs tests:  0
Patch needs improvement:  0             |  Easy pickings:  0
                  UI/UX:  0             |
----------------------------------------+------------------------
 '''Reproduction instructions:'''

 1) Add this to your settings file (I'm not saying it's a good idea)

 {{{
 def KABOOM():
     raise ValueError("KABOOM!")
 }}}

 2) Create a view that raises an uncaught exception

 3) Open the corresponding URL with DEBUG = True

 '''Expected result:'''

 Django's fancy debug page.

 '''Actual result:'''

 Non-descript error page: "A server error occurred.  Please contact the
 administrator."

 ----

 Here the function defined in the settings raises an exception; in fact the
 problem is that Django's debug page will call any callable setting that
 accepts being called without arguments. I admit it's a lousy idea to have
 callable settings; Django favors paths to callables; but it's still a lame
 behavior to call them arbitrarily :)

 This was originally reported against the Debug Toolbar: https://github.com
 /django-debug-toolbar/django-debug-toolbar/issues/252. I'm duplicating the
 issue here because the Debug Toolbar took that code from Django itself.
 I'll update it to follow Django's behavior.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21345>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.fd4dbe11a8d86de433dc9107611fae67%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to