Debug doesn't catch exception instead complains views does not exist
|Reported by:||yeukhon||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
Suppose we have this forms.py:
class SubmitButtonField(forms.Field): # here we write a custom field.... class Editor(forms.Form): script_name = forms.CharField(max_length=60, min_length=1) view_level = forms.ChoiceField(widget=forms.widgets.RadioSelect, choices=VIEW_LEVEL) text_box = forms.CharField(widget=forms.widgets.Textarea, required=False) save_button = forms.SubmitButtonField(required=False) # notice save_button above....
save_button has an error. I accidentally added
forms. in the beginning. This is invalid, and Python will raise exception.
However, when we try to visit the page, it complains about
myapp.views.view_name does not exist.
I fired up django shell, and when I
import myapp.views I got this error:
AttributeError: 'module' object has no attribute 'SubmitButtonField'
Django debug page does not really catch this kind of exception. Is this a bug or an enactment-to-be-made?
Change History (4)
comment:1 Changed 4 years ago by
|Patch needs improvement:||unset|
comment:2 Changed 4 years ago by
|Component:||Uncategorized → Core (URLs)|
|Triage Stage:||Unreviewed → Accepted|
|Type:||Uncategorized → Bug|