Ticket #823: fix-techerror-template.patch

File fix-techerror-template.patch, 3.0 KB (added by Sune Kirkeby <sune.kirkeby@…>, 19 years ago)

Patch to fix the template

  • django/views/debug.py

    === django/views/debug.py
    ==================================================================
     
    101101# always work even if the template loader is broken.
    102102#
    103103
    104 TECHNICAL_500_TEMPLATE = """
    105 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    106 <html lang="en">
     104TECHNICAL_500_TEMPLATE = """<?xml version='1.0' encoding='utf-8'?>
     105<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     106          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     107
     108<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    107109<head>
    108110  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    109111  <meta name="robots" content="NONE,NOARCHIVE" />
     
    144146    #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; }
    145147    #requestinfo h3 { margin-bottom:-1em; }
    146148  </style>
    147   <script type="text/javascript">
     149  <script type="text/javascript">//<!--
    148150    function getElementsByClassName(oElm, strTagName, strClassName){
    149151        // Written by Jonathan Snook, http://www.snook.ca/jon; Add-ons by Robert Nyman, http://www.robertnyman.com
    150152        var arrElements = (strTagName == "*" && document.all)? document.all :
     
    188190      s.innerHTML = s.innerHTML == uarr ? darr : uarr;
    189191      return false;
    190192    }
     193  // -->
    191194  </script>
    192195</head>
    193196<body>
     
    276279          <th>Value</th>
    277280        </tr>
    278281      </thead>
    279       </tbody>
     282      <tbody>
    280283        {% for var in request.GET.items %}
    281284          <tr>
    282285            <td>{{ var.0 }}</td>
     
    286289      </tbody>
    287290    </table>
    288291  {% else %}
    289     <p>No GET data<p>
     292    <p>No GET data</p>
    290293  {% endif %}
    291294
    292295  <h3 id="post-info">POST</h3>
     
    298301          <th>Value</th>
    299302        </tr>
    300303      </thead>
    301       </tbody>
     304      <tbody>
    302305        {% for var in request.POST.items %}
    303306          <tr>
    304307            <td>{{ var.0 }}</td>
     
    308311      </tbody>
    309312    </table>
    310313  {% else %}
    311     <p>No POST data<p>
     314    <p>No POST data</p>
    312315  {% endif %}
    313316
    314317  <h3 id="cookie-info">COOKIES</h3>
     
    320323          <th>Value</th>
    321324        </tr>
    322325      </thead>
    323       </tbody>
     326      <tbody>
    324327        {% for var in request.COOKIES.items %}
    325328          <tr>
    326329            <td>{{ var.0 }}</td>
     
    330333      </tbody>
    331334    </table>
    332335  {% else %}
    333     <p>No cookie data<p>
     336    <p>No cookie data</p>
    334337  {% endif %}
    335338
    336339  <h3 id="meta-info">META</h3>
     
    341344        <th>Value</th>
    342345      </tr>
    343346    </thead>
    344     </tbody>
     347    <tbody>
    345348      {% for var in request.META.items|dictsort:"0" %}
    346349        <tr>
    347350          <td>{{ var.0 }}</td>
     
    360363        <th>Value</th>
    361364      </tr>
    362365    </thead>
    363     </tbody>
     366    <tbody>
    364367      {% for var in settings.items|dictsort:"0" %}
    365368        <tr>
    366369          <td>{{ var.0 }}</td>
     
    449452  </div>
    450453</body>
    451454</html>
    452 """
    453  No newline at end of file
     455"""
Back to Top