404 errors reported as 500 errors

81 views
Skip to first unread message

James Hargreaves

unread,
May 3, 2012, 10:03:46 AM5/3/12
to django...@googlegroups.com
Hello,

I have created a website using Django CMS:


When I visit a URL on this site that does not exist in Django CMS I get a 500 error - eg:


I was expecting a 404 error. Before you say it I don't think this is caused by Django CMS since if I set DEBUG = TRUE in settings.py I get a page not found (404) error as expected. I have the following static files in my template directory:

lrwxrwxrwx 1 jay www-data   10 Apr 11 06:40 403.html -> error.html
lrwxrwxrwx 1 jay www-data   10 May  3 09:24 404.html -> error.html
lrwxrwxrwx 1 jay www-data   10 Apr 11 06:40 500.html -> error.html
-rw-r----- 1 jay www-data  863 Apr 11 20:53 error.html                                                                  

The contents of error.html file is output with the 500 error, which implies that the 500.html symbolic link is working. Why is the 404.html file being ignored? I have tried replacing the symbolic link with a static file but to no avail.

Unfortunately I don't have logging enabled for this site - I'm going to rectify that ASAP but in the meantime can anyone point me in the right direction?

Thanks
James

Kurtis Mullins

unread,
May 3, 2012, 4:41:01 PM5/3/12
to django...@googlegroups.com
Are those symlinks? It might be worth seeing if that's part of the problem (although doubtful that it would be).
If that's not the problem, does Django-CMS have its own specialized 404 handling? I've never used it but it's a couple of ideas to try out.

James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2XzRNeRyrvMJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

James Hargreaves

unread,
May 3, 2012, 5:58:28 PM5/3/12
to django...@googlegroups.com
Thanks for your reply Kurtis.

They are sym-links. I have tried with a plain HTML file too but to no avail.

So far as I know when Django CMS cannot match the URL it throws an Http404 error as you would expect. Indeed that is what I am seeing when I set DEBUG = True in settings.

I assume that there is an error occurring somewhere which is causing the 500 error - maybe middleware is throwing this?

Any ideas would be appreciated but I suspect I need to enable logging and recreate the exception to see what the cause is...
--
a: 1 Oak Cottage, Town Lane, Mobberley, WA16 7HJ
t: 01565 873 019 | 07899 872 306
e: james.ha...@gmail.com

James Hargreaves

unread,
May 4, 2012, 8:14:39 AM5/4/12
to django...@googlegroups.com
This is a double post, sorry.

The below issue has now been resolved - I defined a custom 404 handler some time ago. I removed this previously but forgot to remove the definition from urls.py!

handler404 = application.views.handler404
Reply all
Reply to author
Forward
0 new messages