Commit 6b2d6e18 authored by Luke Plant's avatar Luke Plant
Browse files

Fixed #13590 - Made CSRF failure page styling consistent with Django's default error page styling.

Thanks to alefteris for suggestion.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@13300 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 84060a1f
Loading
Loading
Loading
Loading
+25 −5
Original line number Diff line number Diff line
@@ -11,12 +11,30 @@ CSRF_FAILRE_TEMPLATE = """
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="robots" content="NONE,NOARCHIVE">
  <title>403 Forbidden</title>
  <style type="text/css">
    html * { padding:0; margin:0; }
    body * { padding:10px 20px; }
    body * * { padding:0; }
    body { font:small sans-serif; background:#eee; }
    body>div { border-bottom:1px solid #ddd; }
    h1 { font-weight:normal; margin-bottom:.4em; }
    h1 span { font-size:60%; color:#666; font-weight:normal; }
    #info { background:#f6f6f6; }
    #info ul { margin: 0.5em 4em; }
    #info p { padding-top:10px; }
    #summary { background: #ffc; }
    #explanation { background:#eee; border-bottom: 0px none; }
  </style>
</head>
<body>
  <h1>403 Forbidden</h1>
<div id="summary">
  <h1>Forbidden <span>(403)</span></h1>
  <p>CSRF verification failed. Request aborted.</p>
</div>
{% if DEBUG %}
<div id="info">
  <h2>Help</h2>
    {% if reason %}
    <p>Reason given for failure:</p>
@@ -51,9 +69,11 @@ CSRF_FAILRE_TEMPLATE = """
  and only the initial error message will be displayed.  </p>

  <p>You can customize this page using the CSRF_FAILURE_VIEW setting.</p>
</div>
{% else %}
<div id="explanation">
  <p><small>More information is available with DEBUG=True.</small></p>

</div>
{% endif %}
</body>
</html>