On Tue, Oct 28, 2008 at 4:08 PM, janedenone <[EMAIL PROTECTED]>wrote:
> > Hi Karen, > > I did that, but the message was never sent to me. > That's the first problem I'd be working on fixing, then. Long term you are likely to want that mechanism working, you've got a problem to solve right now for which it would be useful -- I'd be figuring out what's wrong with the settings that is causing the error email to go astray. > Anyway, when I create a new project with a single app, containing > nothing but a single view which raises a Http404, along with a > urlpattern which refers to that view – the 500 template is still > displayed when I request the URL. > > This must be easily reproducible on any machine using the following > code: > > # urls.py: > urlpatterns = patterns('myproject.myapp.views', > (r'^test/$', 'test'), > ) > > # views.py: > def test(request): > raise Http404 > Well yes if that is all you have in views.py then you'll get a 500 error because Http404 has not been imported. But for the DEBUG=True case you'd also be seeing a debug page that starts with: NameError at /test/ and goes on to complain that "global name 'Http404' is not defined" instead of: Page not found (404) and that doesn't match what you said earlier so I'm unsure if you skipped over some details in reporting the code for your minimal example or what it is you see when you have DEBUG set to True. I assure you, if I insert "raise Http404" into the beginning of one of my views, I get my customized 404 template, not a 500 error. Whatever is going on is something specific to your code (or 400.html template), not something fundamentally broken in Django when Http404 is raised with DEBUG set to False. Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---