On Fri, 2008-03-07 at 21:03 -0800, Ken Arnold wrote:
> I just hacked together http://www.djangosnippets.org/snippets/631/
> which includes the technical_500 error view page with the admin error
> email. I did this after seeing a Django site have lots of small errors
> that were difficult to track down because the traceback didn't have
> enough information. Any reason not to include this, as at least an
> option? (or even have some way of overriding the error behavior in a
> subclass, so I don't have to patch the core for this?)

Personally, I'd prefer to allow overriding what happens in the technical
500 response path rather than add something like this.

> Actually there is one big reason not to include this so far: pprint on
> local variable QuerySets is a bad idea -- it can make loading template
> error pages take forever because of database hits, or even fail
> entirely. The problem could be mitigated by printing a repr of the
> query parameters (the SQL, in a pinch) for cases like the debug
> template where you don't want to run the full query.

That's probably not such a great idea, since the query could contain
sensitive data. For the same reason we don't display certain settings
variables in the debug pages, we shouldn't display raw SQL.

> You might say that you should be using the whole queryset anyway (if
> not, why ask the database for extra?), so it's relevant local data.

Not quite a valid assumption. You might very well be further filtering
the queryset at a later point. Or you might not even be using it, but
it's created as part of some generic code you have (it's free to create
a queryset that you don't access, since it never hits the database).

Malcolm

-- 
How many of you believe in telekinesis? Raise my hand... 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to