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

  • Home
  • SEARCH
  • 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 535853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:45:38+00:00 2026-05-13T09:45:38+00:00

If the quantity of the product is a Unicode character, I get UnicodeEncodeError at

  • 0

If the quantity of the product is a Unicode character, I get
UnicodeEncodeError at /add/. When I set DEBUG = False, the satchmo
can’t handle 500 error,it can’t return an HttpResponse object, but the handler404 is ok. I find the following in the apache error log.

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124] mod_wsgi
(pid=10523): Exception occurred processing WSGI script '/etc/httpd/
conf.d/myshop.wsgi'.

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124] Traceback
(most recent call last):

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
etc/httpd/conf.d/myshop.wsgi", line 34, in application[Thu Dec 31
23:05:31 2009] [error] [client 192.168.123.124]     return _application
(environ, start_response)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/core/handlers/
wsgi.py", line 241, in __call__

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]
response = self.get_response(request)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/core/handlers/
base.py", line 134, in get_response

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
self.handle_uncaught_exception(request, resolver, exc_info)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/core/handlers/
base.py", line 166, in handle_uncaught_exception

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
callback(request, **param_dict)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/views/
defaults.py", line 24, in server_error

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
http.HttpResponseServerError(t.render(Context({})))

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 178, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
self.nodelist.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 779, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]
bits.append(self.render_node(node, context))

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 792, in render_node

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
node.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
loader_tags.py", line 97, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
compiled_parent.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 178, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
self.nodelist.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 779, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]
bits.append(self.render_node(node, context))

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 792, in render_node

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
node.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
loader_tags.py", line 24, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     result
= self.nodelist.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 779, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]
bits.append(self.render_node(node, context))

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 792, in render_node

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
node.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
loader_tags.py", line 24, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     result
= self.nodelist.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 779, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]
bits.append(self.render_node(node, context))

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 792, in render_node

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     return
node.render(context)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
__init__.py", line 936, in render

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     dict =
func(*args)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/Satchmo-1.0_pre-py2.5.egg/
satchmo_store/shop/templatetags/satchmo_util.py", line 179, in
satchmo_language_selection_form

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]
request = context['request']

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]   File "/
opt/python-2.5.4/lib/python2.5/site-packages/django/template/
context.py", line 44, in __getitem__

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124]     raise
KeyError(key)

[Thu Dec 31 23:05:31 2009] [error] [client 192.168.123.124] KeyError:
'request' 

here is 500.html:

{% extends "base.html" %}
{% load i18n %}

{% block navbar %}
   <li class="first"><a href="{{ shop_base }}/">{% trans "Home" %}</a></li>
{% endblock %}

{% block content %}

    <h3>{% trans "Error" %}</h3>
    <h4>{% trans "There was an error with the store.  The admin has been notified." %}</h4>

{% endblock %}

and here is base.html:

{% load i18n satchmo_category satchmo_google satchmo_util satchmo_currency satchmo_discounts app_plugins normalize_decimal %}
{% block doctype %}<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
{% endblock %}
<head>
    {% block extra-head %}{% endblock %}
    {% block stylesheet %}<link rel="stylesheet" href="{{ media_url }}css/style.css" />{% endblock %}
    <title>{% block title %}{{ shop_name }}{% if pagetitle %}: {{ pagetitle }}{% endif %}{% endblock %}</title>
    {% plugin_point "page_head" %}
</head>
{% block body %}
contents
{% endblock %}
</html>

Why does django can not handle the 500 error page?

  • 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-13T09:45:38+00:00Added an answer on May 13, 2026 at 9:45 am

    By Django’s documentation,

    The default 500 view passes no
    variables to this template and is
    rendered with an empty Context to
    lessen the chance of additional errors

    I think you should keep the same approach for your 500.html, by not extending base.html, and not even reference i18n, and instead keeping it as simple as possible.

    Consider the context when you get a server error: something got wrong, and you do not know what. You may even be in a situation where not the all of the usual preconditions are fulfilled, and therefore you should maintain the page as simple as possible.
    Personally, I even avoid images, relying only on some ASCII art 🙂

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

Sidebar

Ask A Question

Stats

  • Questions 322k
  • Answers 322k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer IMHO having scheduler call into the controller and execute the… May 14, 2026 at 12:49 am
  • Editorial Team
    Editorial Team added an answer Use fgets() iteratively, then scan the string to see whether… May 14, 2026 at 12:49 am
  • Editorial Team
    Editorial Team added an answer When you use TaskManager to close it, the following happens:… May 14, 2026 at 12:49 am

Related Questions

I have a header.html which start with session_start();. Then the following code, $_SESSION['cart'][$sw_id] is
I've got the following table: CREATE TABLE `products_quantity` ( `id` int(11) NOT NULL auto_increment,
I encountered a behaviour I can´t quite understand when I was trying to populate
I have a CRUD-heavy ASP.NET application with all the business logic in Stored Procedures.
I have an Access 2007 database that works asynchronously with a MAS200 database. Due

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.