I am using django 1.1.4 and python 2.6.6 with mod_wsgi to build a website
The client wants the 404 and 500 pages to have his logo and home page link. I have written simple pages. Its bigger than 512 bytes. I have paced the files in PROJECT_ROOT/templates/
if I set debug to be True
the error says its a 404 error. but when I set it to be False
and try to load a page that does not exist I get an internal server error that looks like this:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log. Apache/2.2.15 (CentOS) Server at www.anglais-verbe.com Port 80
What should I do?
I have not written any views for handling 404, 500 or made changes to the urls.py.
This is my first full fledged django project and I am not sure what is going wrong.
Update:
My admin traceback email is
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 125, in get_response
callback, param_dict = resolver.resolve404()
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 267, in resolve404
return self._resolve_special('404')
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py", line 259, in _resolve_special
callback = getattr(self.urlconf_module, 'handler%s' % view_type)
AttributeError: 'module' object has no attribute 'handler404'
you could set a 404 handler in your main urls.py:
then you have to create the following view in your views.py:
then you could create a template for your 404 in the template folder:
Hope this helps :) This should also work similiar for the 500 error