On 19/03/12 18:12, Sachin Gupta wrote:
Hi,
My name is Sachin Gupta and I am student of Indian Institute of
Technology Roorkee, in my final year of undergraduate course in Computer
Science. I have been developing a project entirely based on Django for
the last 4 months. Here is the link <http://www.mycareerstack.com/> and
it has been absolutely fun using Django. But I have had my share of
trouble with the error reporting so I wanted to contribute to improve
it. In some of the cases the error reports came up were so unrelated it
took me some time to eventually figure it out.
I would like to list a few of them here:
1) One of the very basic one is that in some cases where we may have an
indentation error, it is not reported which file has that error. It just
throws
indentation error in views.py
For a new developer it may appear that the error is in the views.py file
in the root directory(if one such exists) but the error may actually be
in any of the views.py file of the apps.
2) Another error that bugged me for a long time was related with
comment_was_posted signal. I made a mistake in the listener function for
the comment_was_posted signal So whenever I posted a comment, I got the
error
|IntegrityError at/comments/post/|
The integrity error was at the listener of the signal, but the url does
not depict that.
3) Another point (it may be intentional) is that if some attribute is
missing in the Queryset or the attribute name is wrongly written (in the
then template) a TemplateError is not raised. It just fails silently.
Personally, I feel that it should throw some error, otherwise it can
lead to some bugs that might be difficult to discover.
These are some of the errors that, if reported would have made things
easier for me. Although I have used django extensively, I am not quite
familiar with the error reporting facility. I have forked the git
repository on github and will go through it in the next few days.
Since this is also listed as a topic for GSoC 2012, I am interested in
applying for that. Meanwhile it would be great if I can be suggested
some pointers.
Cheers
Sachin Gupta
Hi Sachin,
A few comments from myself:
- The indentation error issue is relatively minor, I'd say - that's a
core Python error, and relatively uncommon (especially if you use a
linter, which I always recommend to people)
- Signals generally can be confusing as they make the control flow
jump around - however, if you're planning to make it more obvious what's
happened, we'd like to see a clear description of what you're going to
improve. The current error page will show you the signal handler towards
the bottom of the traceback, after all.
- Silent template failure is a deliberate design decision in Django,
though it was made many years ago - the idea was that a template editor
couldn't write a template that crashed the site. If you're planning to
change that, you'll need to have good reasoning why and backwards
compatability worked out for all the applications that rely on this
behaviour (some people rely on it and don't realise it - you'll break a
lot of sites if you just change the errors in there to be page-breaking).
I'd recommend you have a look through the
https://code.djangoproject.com/wiki/BetterErrorMessages page in
particular and look at some of the ideas in there - as each particular
area is quite small in scope, we'd be looking for a decent number of
error fixes to form a GSOC proposal that would be considered enough
work. There's some more meaty errors to fix in django.db, for a start.
Andrew
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.