Re: Custom 404's

2009-12-09 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 6:45 PM, Jonas Obrist <ojiido...@gmail.com> wrote:
> Hi django-developers!
>
> I have two things which bug me about custom 404's.
>
> First:
>
> Why isn't there a setting to define a custom 404 template? In Python one
> of the principles is "explicit is better than implicit", a file put in a
> directory looks rather implicit to me, a setting defining the name of
> that file seems better. Also currently django doesn't allow you to be
> consistent in your naming conventions for templates. The designer in my
> team uses .htm extensions for templates and I started to use them as
> well. A 404.html file just looks out of place here. This shouldn't be
> too huge a task to do and I'd be very glad if it would find a place in 1.2.

It isn't a huge task, but it wont be included. This isn't something
that needs to be customizable - it is something that needs to be
utterly predictable. The one place you don't need to be debugging
errors is in your error pages. I'm -1 to anything that increases the
likelihood that you will misconfigure the error pages for a site.

On a stylistic note - ".htm"? Really? 1985 called - they want their
operating system back. :-)

> Second:
>
> The documentation on defining a custom 404 is in the tutorial, in part
> 3. In my opinion the task of defining custom error pages isn't something
> one worries about when learning a new framework, and that's what the
> tutorial should be there for. I don't mind it being in the tutorial,
> however it bugged be when I was looking for it outside the tutorial and
> didn't find it. I propose putting that information or at least a link to
> that information somewhere outside the tutorial. For example in the
> Request/Response documentation in the HttpResponseNotFound section. I'm
> sure you'll be able to find an ideal place for this.

It's in the tutorial because Django's debug 404 isn't shown when
DEBUG=False. If you move a website to production, you _must_ have a
404.html, or you'll get 500 errors every time a 404 is raised.
Therefore, it is important that newcomers know how to set up a 404
template.

As for 404 handling being mentioned elsewhere in the docs: It is
mentioned in the discussion about views [1]. If you think it should be
mentioned somewhere else, open a ticket with your proposed
documentation patch.

[1] 
http://docs.djangoproject.com/en/dev/topics/http/views/#the-http404-exception

Yours,
Russ Magee %-)

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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.




Custom 404's

2009-12-09 Thread Jonas Obrist
Hi django-developers!

I have two things which bug me about custom 404's.

First:

Why isn't there a setting to define a custom 404 template? In Python one 
of the principles is "explicit is better than implicit", a file put in a 
directory looks rather implicit to me, a setting defining the name of 
that file seems better. Also currently django doesn't allow you to be 
consistent in your naming conventions for templates. The designer in my 
team uses .htm extensions for templates and I started to use them as 
well. A 404.html file just looks out of place here. This shouldn't be 
too huge a task to do and I'd be very glad if it would find a place in 1.2.

Second:

The documentation on defining a custom 404 is in the tutorial, in part 
3. In my opinion the task of defining custom error pages isn't something 
one worries about when learning a new framework, and that's what the 
tutorial should be there for. I don't mind it being in the tutorial, 
however it bugged be when I was looking for it outside the tutorial and 
didn't find it. I propose putting that information or at least a link to 
that information somewhere outside the tutorial. For example in the 
Request/Response documentation in the HttpResponseNotFound section. I'm 
sure you'll be able to find an ideal place for this.

- Jonas

--

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@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.