Index: django/views/debug.py
===================================================================
--- django/views/debug.py	(Revision 5223)
+++ django/views/debug.py	(Arbeitskopie)
@@ -122,6 +122,14 @@
             'function': '?',
             'lineno': '?',
         }]
+
+    # Exception values might contain unkown encodings.
+    # Example: Postgres might return latin1 strings.
+    try:
+        exc_value=str(exc_value).decode("latin1")
+    except UnicodeError:
+        exc_value=str(exc_value).decode("utf8", "replace")
+
     t = Template(TECHNICAL_500_TEMPLATE, name='Technical 500 template')
     c = Context({
         'exception_type': exc_type.__name__,
