Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7045121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:29:28+00:00 2026-05-28T02:29:28+00:00

I am using django 1.1.4 and python 2.6.6 with mod_wsgi to build a website

  • 0

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 http://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'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:29:29+00:00Added an answer on May 28, 2026 at 2:29 am

    you could set a 404 handler in your main urls.py:

    handler404 = 'yourproject.views.file_not_found_404'
    

    then you have to create the following view in your views.py:

    from django.shortcuts import render_to_response
    from django.template import RequestContext
    
    def file_not_found_404(request):
        #create some variables here if you like
        path = request.path
        response = render_to_response('404.html', locals(),
                                  context_instance=RequestContext(request))
        response.status_code = 404
    return (response)
    

    then you could create a template for your 404 in the template folder:

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>404 Not Found</title>
    </head><body>
    <h1>Not Found</h1>
    <p>The requested URL {{ path }} was not found on this server.</p>
    <hr>
    <address>Apache/2.2.3 (CentOS) Server at yourdomain.com port 80</address>
    </body></html>
    

    Hope this helps 🙂
    This should also work similiar for the 500 error

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple mail sending application which runs in python using Django. After
I'm using Django and Python 2.6, and I want to grow my application using
I am working on a web application using Python (Django) and would like to
When starting a django application using python manage.py shell , I get an InteractiveConsole
I am using Google motion-charts in a web-site developed in python/django. Is there a
I'm fairly new to both Django and Python. This is my first time using
In Django I am using two applications: python manage.py startapp books python manage.py startapp
I was using python 2.5 and django 1.0.2. But I moved to python 2.6
My setup is Django 1.2 running via mod_wsgi under Debian Lenny. I have a
I'm building a site for a client using django. It's been hosted on shared

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.