getting 500 131 error on page not found

35 views
Skip to first unread message

Sabine Maennel

unread,
Oct 21, 2014, 12:19:37 PM10/21/14
to django...@googlegroups.com

I really do not understand what is happening. I have a 404.html along with a 500.html in my template directory. They are both simple and look like this:

404.html:

<h1>Server Error 404!</h1>
<h3>Das netTeachers-Team ist informiert und kümmert sich darum.
Wir hoffen auf Ihr Verständnis.</h3>

500.html:

<h1>Server Error 500!</h1>
<h3>Das netTeachers-Team ist informiert und kümmert sich darum.
Wir hoffen auf Ihr Verständnis.</h3>

When I put in a non existent url on runserver and DEBUG=False, I get this error in my log: [21/Oct/2014 16:08:56] "GET /x HTTP/1.1" 500 131

It seems like he does not find my 404.html Template but why???

My settings.py looks like this in the part of template directories:

import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

ROOT_URLCONF = 'netteachers.urls'

TEMPLATE_DIRS = (
    os.path.join(BASE_DIR, 'templates'),
)

CRISPY_TEMPLATE_PACK = 'bootstrap3'

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    'django.core.context_processors.request',
    "django.contrib.messages.context_processors.messages",
    "core.context_processors.resolvermatch",
)

Please can anybody tell me what I am doing wrong! Thanks in advance!


Collin Anderson

unread,
Oct 21, 2014, 1:22:56 PM10/21/14
to django...@googlegroups.com
Hi Sabine,

It may be an issue with your core.context_processors.resolvermatch.

I recommend setting ADMINS so you get the error emailed to you.

Collin

Tom Evans

unread,
Oct 21, 2014, 3:02:48 PM10/21/14
to django...@googlegroups.com
You have DEBUG=True on, so you will never see your custom 404 page:

https://docs.djangoproject.com/en/1.7/ref/views/#http-not-found-view

Cheers

Tom

Sabine Maennel

unread,
Oct 22, 2014, 6:15:11 AM10/22/14
to django...@googlegroups.com
Dear Tom,  Thanks for your reply, but I did not have DEBUG=True on. With DEBUG=True the program behaves as expected. Things go wrong just when I set DEBUG=False. But thanks anyway for your reply.

Sabine Maennel

unread,
Oct 22, 2014, 6:26:35 AM10/22/14
to django...@googlegroups.com
Dear Collin,

you hit the nail right right on top. That was it! I feel so thankful towards you! I would never have thought about the context processors. 

I am so thankful to everybody here in the Django User group to always taking the time and helping me out. I will try to give back, as soon as I get to be more experienced! 

I have the ADMINS setting in place in my production settings file, Collin. I was just trying to understand the error in my local environment first, since it occurred even there.

You have been helping me out quite a lot lately. Where are you located? How long have you been doing Django?
   Thanks again and with kind regards
         Sabine Maennel 

Collin Anderson

unread,
Oct 23, 2014, 8:18:26 AM10/23/14
to django...@googlegroups.com
Where are you located? How long have you been doing Django?
South Bend, IN, USA. I've been using Django since 2006, but just started posting to the mailing list recently. 
Reply all
Reply to author
Forward
0 new messages