
7ec           @  s  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l m Z m	 Z	 d  d l
 m Z m Z m Z d  d l m Z m Z d  d l m Z m Z d  d l m Z m Z m Z d  d	 l m Z d  d
 l m Z m Z d  d l m Z d  d l m  Z! e d e"  Z# e j$ d d e j% Z& d Z' d e( f d     YZ) d   Z* d   Z+ d d  Z, e j   d    Z- d   Z. d e( f d     YZ/ d e/ f d     YZ0 d e( f d     YZ1 d   Z2 d    Z3 d! Z4 d" Z5 d# Z6 d$ Z7 d S(%   i(   t   unicode_literalsN(   t   settings(   t   HttpResponset   HttpResponseNotFound(   t   Contextt   Enginet   TemplateDoesNotExist(   t   force_escapet   pprint(   t   Resolver404t   resolve(   t	   lru_cachet   sixt   timezone(   t   MultiValueDict(   t   force_bytest
   force_text(   t   import_string(   t   ugettextt   debugu#   API|TOKEN|KEY|SECRET|PASS|SIGNATUREt   flagsu   ********************t   CallableSettingWrapperc           B  s    e  Z d  Z d   Z d   Z RS(   u    Object to wrap callable appearing in settings

    * Not to call in the debug page (#21345).
    * Not to break the debug page if the callable forbidding to set attributes (#23070).
    c         C  s   | |  _  d  S(   N(   t   _wrapped(   t   selft   callable_setting(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   __init__!   s    c         C  s   t  |  j  S(   N(   t   reprR   (   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   __repr__$   s    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyR      s   	c         C  s   yJ t  j |   r t } n. t | t  rC d   | j   D } n | } Wn t k
 rc | } n Xt |  r t |  } n  | S(   u   Cleanse an individual setting key/value of sensitive content.

    If the value is a dictionary, recursively cleanse the keys in
    that dictionary.
    c         S  s(   i  |  ] \ } } t  | |  |  q S(    (   t   cleanse_setting(   t   .0t   kt   v(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pys
   <dictcomp>3   s   	 (	   t   HIDDEN_SETTINGSt   searcht   CLEANSED_SUBSTITUTEt
   isinstancet   dictt   itemst	   TypeErrort   callableR   (   t   keyt   valuet   cleansed(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyR   (   s    	

c          C  sL   i  }  x? t  t  D]1 } | j   r t | t t |   |  | <q q W|  S(   uQ   Returns a dictionary of the settings module, with sensitive settings blurred out.(   t   dirR   t   isupperR   t   getattr(   t   settings_dictR!   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   get_safe_settingsA   s
    #i  c         C  si   t  |  | | |  } |  j   rC | j   } t | d | d d S| j   } t | d | d d Sd S(   u   
    Create a technical server error response. The last three arguments are
    the values returned from sys.exc_info() and friends.
    t   statust   content_typeu
   text/plainu	   text/htmlN(   t   ExceptionReportert   is_ajaxt   get_traceback_textR   t   get_traceback_html(   t   requestt   exc_typet	   exc_valuet   tbt   status_codet   reportert   textt   html(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   technical_500_responseJ   s    c           C  s   t  t j    S(   N(   R   R   t!   DEFAULT_EXCEPTION_REPORTER_FILTER(    (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt%   get_default_exception_reporter_filterX   s    c         C  s   t    } t |  d |  S(   Nu   exception_reporter_filter(   RC   R0   (   R9   t   default_filter(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   get_exception_reporter_filter^   s    	t   ExceptionReporterFilterc           B  s    e  Z d  Z d   Z d   Z RS(   uv   
    Base for all exception reporter filter classes. All overridable hooks
    contain lenient default behaviors.
    c         C  s   | d  k r i  S| j Sd  S(   N(   t   Nonet   POST(   R   R9   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   get_post_parametersi   s    c         C  s   t  | j j    S(   N(   t   listt   f_localsR(   (   R   R9   t   tb_frame(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   get_traceback_frame_variableso   s    (   R   R   R   RI   RM   (    (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyRF   c   s   	t   SafeExceptionReporterFilterc           B  s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   u   
    Use annotations made by the sensitive_post_parameters and
    sensitive_variables decorators to filter out sensitive information.
    c         C  s   t  j t k S(   u  
        This filter is to add safety in production environments (i.e. DEBUG
        is False). If DEBUG is True then your site is not safe anyway.
        This hook is provided as a convenience to easily activate or
        deactivate the filter on a per request basis.
        (   R   t   DEBUGt   False(   R   R9   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt	   is_activey   s    c         C  sd   t  | d g   } |  j |  r` | r` | j   } x* | D] } | | k r: t | | <q: q: Wn  | S(   u   
        Replaces the keys in a MultiValueDict marked as sensitive with stars.
        This mitigates leaking sensitive POST parameters if something like
        request.POST['nonexistent_key'] throws an exception (#21098).
        u   sensitive_post_parameters(   R0   RQ   t   copyR%   (   R   R9   t   multivaluedictt   sensitive_post_parameterst   param(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   get_cleansed_multivaluedict   s    c         C  s   | d k r i  St | d g   } |  j |  r | r | j j   } | d k r} x$ | j   D] \ } } t | | <q_ W| Sx' | D] } | | k r t | | <q q W| Sn | j Sd S(   ul   
        Replaces the values of POST parameters marked as sensitive with
        stars (*********).
        u   sensitive_post_parametersu   __ALL__N(   RG   R0   RQ   RH   RR   R(   R%   (   R   R9   RT   R-   R!   R"   RU   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyRI      s    c         C  sU   y t  | t  } Wn  t k
 r5 } d j | |  SX| rQ |  j | |  } n  | S(   Nu   {!r} while evaluating {!r}(   R&   R   t	   Exceptiont   formatRV   (   R   R9   R,   t   is_multivalue_dictt   e(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   cleanse_special_types   s    c   	      C  s  | j  } d } x] | d k	 rn | j j d k rb d | j k rb | j d } t | d d  } Pn  | j  } q Wi  } |  j |  r| r| d k r x{ | j j   D] \ } } t | | <q WqMx | j j   D]= \ } } | | k r t } n |  j	 | |  } | | | <q Wn6 x3 | j j   D]" \ } } |  j	 | |  | | <q'W| j j d k rd | j k rt | d <t | d <n  | j   S(   uf   
        Replaces the values of variables marked as sensitive with
        stars (*********).
        u   sensitive_variables_wrapperu   sensitive_variablesu   __ALL__u	   func_argsu   func_kwargsN(
   t   f_backRG   t   f_codet   co_nameRK   R0   RQ   R(   R%   R[   (	   R   R9   RL   t   current_framet   sensitive_variablest   wrapperR-   t   nameR,   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyRM      s4    		
(   R   R   R   RQ   RV   RI   R[   RM   (    (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyRN   s   s   					R5   c           B  sV   e  Z d  Z e d  Z d   Z d   Z d   Z d d d  Z	 d   Z
 d   Z RS(	   uE   
    A class to organize and coordinate reporting on exceptions.
    c         C  sm   | |  _  t |  j   |  _ | |  _ | |  _ | |  _ | |  _ t |  j d d   |  _	 t
 |  _ d  |  _ d  S(   Nu   template_debug(   R9   RE   t   filterR:   R;   R<   t   is_emailR0   RG   t   template_infoRP   t   template_does_not_existt
   postmortem(   R   R9   R:   R;   R<   Rd   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyR      s    						c         C  s  |  j  rB t |  j  t  rB t |  _ |  j j p9 |  j g |  _ n  |  j   } x t	 |  D] \ } } d | k rg  } x | d D] \ } } t
 |  } t | t j  r | j d d  } n  t |  d k r d | d d !t |  f } n  | j | t |  f  q W| | d <n  | | | <q[ Wd } |  j  rt |  j  t  rt |  j d d(  } t |  j d	 d(  }	 | d( k	 r|	 d( k	 r|  j j d
 }
 t |
 t | d d  t |	 d t |
   !d d d } qn  d d l m } |  j d( k r
d( } n0 y t |  j j  } Wn t k
 r9d } n Xi |  j d 6| d 6| d 6|  j d 6| d 6t |  j  j! |  j  j"    d 6t#   d 6t$ j% d 6d t$ j& d d !d 6t' j(   d 6|   d 6t$ j) d 6|  j* d 6|  j d  6|  j d! 6} |  j d( k	 rG|  j j+ j"   | d" <|  j j, j"   | d# <|  j j- j"   | d$ <n  |  j  rc|  j  j. | d% <n  |  j rt |  j d d | d& <n  | r| d | d' <n  | S()   u5   Return a dictionary containing traceback information.u   varsu   utf-8u   replacei   u   %s... <trimmed %d bytes string>i    u    u   startu   endi   i   u   asciit   errorsi(   t   get_versionu%   [unable to retrieve the current user]u   is_emailu   unicode_hintu   framesu   requestu   user_stru   filtered_POST_itemsu   settingsu   sys_executableu   %d.%d.%di   u   sys_version_infou   server_timeu   django_version_infou   sys_pathu   template_infou   template_does_not_existu
   postmortemu   request_GET_itemsu   request_FILES_itemsu   request_COOKIES_itemsu   exception_typeu   exception_valueu	   lastframeN(/   R:   t
   issubclassR   t   TrueRf   R;   t   chainRg   t   get_traceback_framest	   enumerateR   R&   R   t   binary_typet   decodet   lent   appendR   t   UnicodeErrorR0   RG   t   argsR   t   maxt   mint   djangoRi   R9   t   userRW   Rd   RJ   Rc   RI   R(   R2   t   syst
   executablet   version_infoR   t   nowt   pathRe   t   GETt   FILESt   COOKIESR   (   R   t   framest   it   framet
   frame_varsR!   R"   t   unicode_hintt   startt   endt   unicode_strRi   t   user_strt   c(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   get_traceback_data   sv    	 *	


"





		c         C  s4   t  j t  } t |  j   d t } | j |  S(   u1   Return HTML version of debug 500 HTTP error page.t   use_l10n(   t   DEBUG_ENGINEt   from_stringt   TECHNICAL_500_TEMPLATER   R   RP   t   render(   R   t   tR   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyR8   D  s    c         C  s:   t  j t  } t |  j   d t d t } | j |  S(   u7   Return plain text version of debug 500 HTTP error page.t
   autoescapeR   (   R   R   t   TECHNICAL_500_TEXT_TEMPLATER   R   RP   R   (   R   R   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyR7   J  s    c         C  s  d } | d k	 rf t | d  rf y | j |  } Wn t k
 rG n X| d k	 rf | j   } qf n  | d k r y. t | d   } | j   j   } Wd QXWq t t f k
 r q Xn  | d k r d g  d g  f St	 | d t
 j  rid } xF | d  D]: }	 t j d |	  }
 |
 r |
 j d  j d  } Pq q Wg  | D] } t
 j | | d	  ^ qE} n  t d | |  } | | } | | | !} | | } | | d | !} | | | | f S(
   u   
        Returns context_lines before and after lineno from file.
        Returns (pre_context_lineno, pre_context, context_line, post_context).
        u
   get_sourceu   rbNi    u   asciii   s   coding[:=]\s*([-\w.]+)i   u   replace(   RG   t   hasattrt
   get_sourcet   ImportErrort
   splitlinest   opent   readt   OSErrort   IOErrorR&   R   Ro   t   reR$   t   groupRp   t	   text_typeRu   (   R   t   filenamet   linenot   context_linest   loadert   module_namet   sourcet   fpt   encodingt   linet   matcht   slinet   lower_boundt   upper_boundt   pre_contextt   context_linet   post_context(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   _get_lines_from_fileP  s<    +

c         C  s@  d   } g  } |  j  } x# | r= | j |  | |  } q Wg  } | sN | S| j   } t j sj | rs |  j n | j } x| d  k	 r;| j j	 j
 d  r | j } q n  | j j j } | j j j } | j d } | j j j
 d  }	 | j j j
 d  pd }
 |  j | | d |	 |
  \ } } } } | d  k	 r| j i | |  d 6t | d	 t  d
 6| d 6|
 j d  rd n d d 6| d 6| d 6| d d 6|  j j |  j | j  d 6t |  d 6| d 6| d 6| d 6| d d 6 n  t j r| j } q | j r/| r/| j   } | j } q | j } q W| S(   Nc         S  s.   t  |  d d   } t  |  d d   } | p- | S(   Nu	   __cause__u   __context__(   R0   RG   (   R;   t   explicitt   implicit(    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   explicit_or_implicit_cause~  s    u   __traceback_hide__i   u
   __loader__u   __name__u    i   u	   exc_causeu	   __cause__u   exc_cause_explicitu   tbu   django.u   djangou   useru   typeu   filenameu   functionu   linenou   varsu   idu   pre_contextu   context_lineu   post_contextu   pre_context_lineno(   R;   Rr   t   popR   t   PY2R<   t   __traceback__RG   RL   RK   t   gett   tb_nextR]   t   co_filenameR^   t	   tb_linenot	   f_globalsR   R0   Rk   t
   startswithRc   RM   R9   t   id(   R   R   t
   exceptionsR;   R   R<   R   t   functionR   R   R   t   pre_context_linenoR   R   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyRm   }  sX    			"	!		c         C  s   d d l  } |  j   } g  | D]( } | d | d | d | d f ^ q } d g } | | j |  7} | | j |  j |  j  7} | S(   uJ   
        Return the same data as from traceback.format_exception.
        iNu   filenameu   linenou   functionu   context_lineu#   Traceback (most recent call last):
(   t	   tracebackRm   t   format_listt   format_exception_onlyR:   R;   (   R   R   R   t   fR<   RJ   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   format_exception  s    5	N(   R   R   R   RP   R   R   R8   R7   RG   R   Rm   R   (    (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyR5      s   	J		-	Cc         C  s`  y | j  d d } Wn' t t t f k
 r> |  j d } n Xy | j  d d } Wn  t t t f k
 rv g  } n X| s |  j d k rt |  d k rt | d  d k rt | d d d d  t | d d d d  k o d	 k n rt |   St |  d
 t	 j
  } t | t j  r6| j } n  d } y t |  j  } Wn t k
 rbn X| j } t | d  r| j } n0 t | d  rt | j d  r| j j } n  t | d  r| j } d | | f } n  t j t  }	 t i | d
 6t	 j
 d 6| d 6| d 6t | d d d 6|  d 6t   d 6| d 6 }
 t |	 j |
  d d S(   uK   Create a technical 404 error response. The exception should be the Http404.i    u   pathi   u   triedu   /u   app_nameu    u	   namespaceu   adminu   urlconfu   __name__u	   __class__u
   __module__u   %s.%su   root_urlconfu   request_pathu   urlpatternsRh   u   replaceu   reasonu   requestu   settingsu   raising_view_nameR4   u	   text/html(   Rt   t
   IndexErrorR)   t   KeyErrort	   path_infoR}   Rq   R0   t   default_urlconfR   t   ROOT_URLCONFR&   t   typest
   ModuleTypeR   R
   R	   t   funcR   t	   __class__R   R   R   t   TECHNICAL_404_TEMPLATER   R   R2   R   R   (   R9   t	   exceptiont	   error_urlt   triedt   urlconft   callert   resolver_matcht   objt   moduleR   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   technical_404_response  sR    
D
	!	

c         C  su   t  j t  } t i t d  d 6t d  d 6t d  d 6t d  d 6t d	  d
 6 } t | j |  d d S(   u+   Create an empty URLconf 404 error response.u   Welcome to Djangou   titleu
   It worked!u   headingu2   Congratulations on your first Django-powered page.u
   subheadinguY   Next, start your first app by running <code>python manage.py startapp [app_label]</code>.u   instructionsu   You're seeing this message because you have <code>DEBUG = True</code> in your Django settings file and you haven't configured any URLs. Get to work!u   explanationR4   u	   text/html(   R   R   t   DEFAULT_URLCONF_TEMPLATER   t   _R   R   (   R9   R   R   (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyR     s    
uG  
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="robots" content="NONE,NOARCHIVE">
  <title>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %}{% if request %} at {{ request.path_info|escape }}{% endif %}</title>
  <style type="text/css">
    html * { padding:0; margin:0; }
    body * { padding:10px 20px; }
    body * * { padding:0; }
    body { font:small sans-serif; }
    body>div { border-bottom:1px solid #ddd; }
    h1 { font-weight:normal; }
    h2 { margin-bottom:.8em; }
    h2 span { font-size:80%; color:#666; font-weight:normal; }
    h3 { margin:1em 0 .5em 0; }
    h4 { margin:0 0 .5em 0; font-weight: normal; }
    code, pre { font-size: 100%; white-space: pre-wrap; }
    table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; }
    tbody td, tbody th { vertical-align:top; padding:2px 3px; }
    thead th {
      padding:1px 6px 1px 3px; background:#fefefe; text-align:left;
      font-weight:normal; font-size:11px; border:1px solid #ddd;
    }
    tbody th { width:12em; text-align:right; color:#666; padding-right:.5em; }
    table.vars { margin:5px 0 2px 40px; }
    table.vars td, table.req td { font-family:monospace; }
    table td.code { width:100%; }
    table td.code pre { overflow:hidden; }
    table.source th { color:#666; }
    table.source td { font-family:monospace; white-space:pre; border-bottom:1px solid #eee; }
    ul.traceback { list-style-type:none; color: #222; }
    ul.traceback li.frame { padding-bottom:1em; color:#666; }
    ul.traceback li.user { background-color:#e0e0e0; color:#000 }
    div.context { padding:10px 0; overflow:hidden; }
    div.context ol { padding-left:30px; margin:0 10px; list-style-position: inside; }
    div.context ol li { font-family:monospace; white-space:pre; color:#777; cursor:pointer; padding-left: 2px; }
    div.context ol li pre { display:inline; }
    div.context ol.context-line li { color:#505050; background-color:#dfdfdf; padding: 3px 2px; }
    div.context ol.context-line li span { position:absolute; right:32px; }
    .user div.context ol.context-line li { background-color:#bbb; color:#000; }
    .user div.context ol li { color:#666; }
    div.commands { margin-left: 40px; }
    div.commands a { color:#555; text-decoration:none; }
    .user div.commands a { color: black; }
    #summary { background: #ffc; }
    #summary h2 { font-weight: normal; color: #666; }
    #explanation { background:#eee; }
    #template, #template-not-exist { background:#f6f6f6; }
    #template-not-exist ul { margin: 0 0 10px 20px; }
    #template-not-exist .postmortem-section { margin-bottom: 3px; }
    #unicode-hint { background:#eee; }
    #traceback { background:#eee; }
    #requestinfo { background:#f6f6f6; padding-left:120px; }
    #summary table { border:none; background:transparent; }
    #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; }
    #requestinfo h3 { margin-bottom:-1em; }
    .error { background: #ffc; }
    .specific { color:#cc3300; font-weight:bold; }
    h2 span.commands { font-size:.7em;}
    span.commands a:link {color:#5E5694;}
    pre.exception_value { font-family: sans-serif; color: #666; font-size: 1.5em; margin: 10px 0 10px 0; }
    .append-bottom { margin-bottom: 10px; }
  </style>
  {% if not is_email %}
  <script type="text/javascript">
  //<!--
    function getElementsByClassName(oElm, strTagName, strClassName){
        // Written by Jonathan Snook, http://www.snook.ca/jon; Add-ons by Robert Nyman, http://www.robertnyman.com
        var arrElements = (strTagName == "*" && document.all)? document.all :
        oElm.getElementsByTagName(strTagName);
        var arrReturnElements = new Array();
        strClassName = strClassName.replace(/\-/g, "\\-");
        var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
        var oElement;
        for(var i=0; i<arrElements.length; i++){
            oElement = arrElements[i];
            if(oRegExp.test(oElement.className)){
                arrReturnElements.push(oElement);
            }
        }
        return (arrReturnElements)
    }
    function hideAll(elems) {
      for (var e = 0; e < elems.length; e++) {
        elems[e].style.display = 'none';
      }
    }
    window.onload = function() {
      hideAll(getElementsByClassName(document, 'table', 'vars'));
      hideAll(getElementsByClassName(document, 'ol', 'pre-context'));
      hideAll(getElementsByClassName(document, 'ol', 'post-context'));
      hideAll(getElementsByClassName(document, 'div', 'pastebin'));
    }
    function toggle() {
      for (var i = 0; i < arguments.length; i++) {
        var e = document.getElementById(arguments[i]);
        if (e) {
          e.style.display = e.style.display == 'none' ? 'block': 'none';
        }
      }
      return false;
    }
    function varToggle(link, id) {
      toggle('v' + id);
      var s = link.getElementsByTagName('span')[0];
      var uarr = String.fromCharCode(0x25b6);
      var darr = String.fromCharCode(0x25bc);
      s.textContent = s.textContent == uarr ? darr : uarr;
      return false;
    }
    function switchPastebinFriendly(link) {
      s1 = "Switch to copy-and-paste view";
      s2 = "Switch back to interactive view";
      link.textContent = link.textContent.trim() == s1 ? s2: s1;
      toggle('browserTraceback', 'pastebinTraceback');
      return false;
    }
    //-->
  </script>
  {% endif %}
</head>
<body>
<div id="summary">
  <h1>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %}{% if request %} at {{ request.path_info|escape }}{% endif %}</h1>
  <pre class="exception_value">{% if exception_value %}{{ exception_value|force_escape }}{% else %}No exception message supplied{% endif %}</pre>
  <table class="meta">
{% if request %}
    <tr>
      <th>Request Method:</th>
      <td>{{ request.META.REQUEST_METHOD }}</td>
    </tr>
    <tr>
      <th>Request URL:</th>
      <td>{{ request.get_raw_uri|escape }}</td>
    </tr>
{% endif %}
    <tr>
      <th>Django Version:</th>
      <td>{{ django_version_info }}</td>
    </tr>
{% if exception_type %}
    <tr>
      <th>Exception Type:</th>
      <td>{{ exception_type }}</td>
    </tr>
{% endif %}
{% if exception_type and exception_value %}
    <tr>
      <th>Exception Value:</th>
      <td><pre>{{ exception_value|force_escape }}</pre></td>
    </tr>
{% endif %}
{% if lastframe %}
    <tr>
      <th>Exception Location:</th>
      <td>{{ lastframe.filename|escape }} in {{ lastframe.function|escape }}, line {{ lastframe.lineno }}</td>
    </tr>
{% endif %}
    <tr>
      <th>Python Executable:</th>
      <td>{{ sys_executable|escape }}</td>
    </tr>
    <tr>
      <th>Python Version:</th>
      <td>{{ sys_version_info }}</td>
    </tr>
    <tr>
      <th>Python Path:</th>
      <td><pre>{{ sys_path|pprint }}</pre></td>
    </tr>
    <tr>
      <th>Server time:</th>
      <td>{{server_time|date:"r"}}</td>
    </tr>
  </table>
</div>
{% if unicode_hint %}
<div id="unicode-hint">
    <h2>Unicode error hint</h2>
    <p>The string that could not be encoded/decoded was: <strong>{{ unicode_hint|force_escape }}</strong></p>
</div>
{% endif %}
{% if template_does_not_exist %}
<div id="template-not-exist">
    <h2>Template-loader postmortem</h2>
    {% if postmortem %}
        <p class="append-bottom">Django tried loading these templates, in this order:</p>
        {% for entry in postmortem %}
            <p class="postmortem-section">Using engine <code>{{ entry.backend.name }}</code>:</p>
            <ul>
                {% if entry.tried %}
                    {% for attempt in entry.tried %}
                        <li><code>{{ attempt.0.loader_name }}</code>: {{ attempt.0.name }} ({{ attempt.1 }})</li>
                    {% endfor %}
                {% else %}
                    <li>This engine did not provide a list of tried templates.</li>
                {% endif %}
            </ul>
        {% endfor %}
    {% else %}
        <p>No templates were found because your 'TEMPLATES' setting is not configured.</p>
    {% endif %}
</div>
{% endif %}
{% if template_info %}
<div id="template">
   <h2>Error during template rendering</h2>
   <p>In template <code>{{ template_info.name }}</code>, error at line <strong>{{ template_info.line }}</strong></p>
   <h3>{{ template_info.message }}</h3>
   <table class="source{% if template_info.top %} cut-top{% endif %}
      {% if template_info.bottom != template_info.total %} cut-bottom{% endif %}">
   {% for source_line in template_info.source_lines %}
   {% if source_line.0 == template_info.line %}
   <tr class="error"><th>{{ source_line.0 }}</th>
     <td>{{ template_info.before }}<span class="specific">{{ template_info.during }}</span>{{ template_info.after }}</td>
   </tr>
   {% else %}
      <tr><th>{{ source_line.0 }}</th>
      <td>{{ source_line.1 }}</td></tr>
   {% endif %}
   {% endfor %}
   </table>
</div>
{% endif %}
{% if frames %}
<div id="traceback">
  <h2>Traceback <span class="commands">{% if not is_email %}<a href="#" onclick="return switchPastebinFriendly(this);">
    Switch to copy-and-paste view</a></span>{% endif %}
  </h2>
  <div id="browserTraceback">
    <ul class="traceback">
      {% for frame in frames %}
        {% ifchanged frame.exc_cause %}{% if frame.exc_cause %}
          <li><h3>
          {% if frame.exc_cause_explicit %}
            The above exception ({{ frame.exc_cause|force_escape }}) was the direct cause of the following exception:
          {% else %}
            During handling of the above exception ({{ frame.exc_cause|force_escape }}), another exception occurred:
          {% endif %}
        </h3></li>
        {% endif %}{% endifchanged %}
        <li class="frame {{ frame.type }}">
          <code>{{ frame.filename }}</code> in <code>{{ frame.function }}</code>

          {% if frame.context_line %}
            <div class="context" id="c{{ frame.id }}">
              {% if frame.pre_context and not is_email %}
                <ol start="{{ frame.pre_context_lineno }}" class="pre-context" id="pre{{ frame.id }}">
                {% for line in frame.pre_context %}
                  <li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')"><pre>{{ line }}</pre></li>
                {% endfor %}
                </ol>
              {% endif %}
              <ol start="{{ frame.lineno }}" class="context-line">
                <li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')"><pre>
{{ frame.context_line }}</pre>{% if not is_email %} <span>...</span>{% endif %}</li></ol>
              {% if frame.post_context and not is_email  %}
                <ol start='{{ frame.lineno|add:"1" }}' class="post-context" id="post{{ frame.id }}">
                  {% for line in frame.post_context %}
                  <li onclick="toggle('pre{{ frame.id }}', 'post{{ frame.id }}')"><pre>{{ line }}</pre></li>
                  {% endfor %}
              </ol>
              {% endif %}
            </div>
          {% endif %}

          {% if frame.vars %}
            <div class="commands">
                {% if is_email %}
                    <h2>Local Vars</h2>
                {% else %}
                    <a href="#" onclick="return varToggle(this, '{{ frame.id }}')"><span>&#x25b6;</span> Local vars</a>
                {% endif %}
            </div>
            <table class="vars" id="v{{ frame.id }}">
              <thead>
                <tr>
                  <th>Variable</th>
                  <th>Value</th>
                </tr>
              </thead>
              <tbody>
                {% for var in frame.vars|dictsort:0 %}
                  <tr>
                    <td>{{ var.0 }}</td>
                    <td class="code"><pre>{{ var.1 }}</pre></td>
                  </tr>
                {% endfor %}
              </tbody>
            </table>
          {% endif %}
        </li>
      {% endfor %}
    </ul>
  </div>
  <form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post">
{% if not is_email %}
  <div id="pastebinTraceback" class="pastebin">
    <input type="hidden" name="language" value="PythonConsole">
    <input type="hidden" name="title"
      value="{{ exception_type|escape }}{% if request %} at {{ request.path_info|escape }}{% endif %}">
    <input type="hidden" name="source" value="Django Dpaste Agent">
    <input type="hidden" name="poster" value="Django">
    <textarea name="content" id="traceback_area" cols="140" rows="25">
Environment:

{% if request %}
Request Method: {{ request.META.REQUEST_METHOD }}
Request URL: {{ request.get_raw_uri|escape }}
{% endif %}
Django Version: {{ django_version_info }}
Python Version: {{ sys_version_info }}
Installed Applications:
{{ settings.INSTALLED_APPS|pprint }}
Installed Middleware:
{% if settings.MIDDLEWARE is not None %}{{ settings.MIDDLEWARE|pprint }}{% else %}{{ settings.MIDDLEWARE_CLASSES|pprint }}{% endif %}

{% if template_does_not_exist %}Template loader postmortem
{% if postmortem %}Django tried loading these templates, in this order:
{% for entry in postmortem %}
Using engine {{ entry.backend.name }}:
{% if entry.tried %}{% for attempt in entry.tried %}    * {{ attempt.0.loader_name }}: {{ attempt.0.name }} ({{ attempt.1 }})
{% endfor %}{% else %}    This engine did not provide a list of tried templates.
{% endif %}{% endfor %}
{% else %}No templates were found because your 'TEMPLATES' setting is not configured.
{% endif %}{% endif %}{% if template_info %}
Template error:
In template {{ template_info.name }}, error at line {{ template_info.line }}
   {{ template_info.message }}{% for source_line in template_info.source_lines %}{% if source_line.0 == template_info.line %}   {{ source_line.0 }} : {{ template_info.before }} {{ template_info.during }} {{ template_info.after }}{% else %}   {{ source_line.0 }} : {{ source_line.1 }}{% endif %}{% endfor %}{% endif %}

Traceback:{% for frame in frames %}
{% ifchanged frame.exc_cause %}{% if frame.exc_cause %}{% if frame.exc_cause_explicit %}
The above exception ({{ frame.exc_cause|force_escape }}) was the direct cause of the following exception:
{% else %}
During handling of the above exception ({{ frame.exc_cause|force_escape }}), another exception occurred:
{% endif %}{% endif %}{% endifchanged %}
File "{{ frame.filename|escape }}" in {{ frame.function|escape }}
{% if frame.context_line %}  {{ frame.lineno }}. {{ frame.context_line|escape }}{% endif %}{% endfor %}

Exception Type: {{ exception_type|escape }}{% if request %} at {{ request.path_info|escape }}{% endif %}
Exception Value: {{ exception_value|force_escape }}
</textarea>
  <br><br>
  <input type="submit" value="Share this traceback on a public website">
  </div>
</form>
</div>
{% endif %}
{% endif %}

<div id="requestinfo">
  <h2>Request information</h2>

{% if request %}
  {% if user_str %}
    <h3 id="user-info">USER</h3>
    <p>{{ user_str }}</p>
  {% endif %}

  <h3 id="get-info">GET</h3>
  {% if request.GET %}
    <table class="req">
      <thead>
        <tr>
          <th>Variable</th>
          <th>Value</th>
        </tr>
      </thead>
      <tbody>
        {% for k, v in request_GET_items %}
          <tr>
            <td>{{ k }}</td>
            <td class="code"><pre>{{ v|pprint }}</pre></td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  {% else %}
    <p>No GET data</p>
  {% endif %}

  <h3 id="post-info">POST</h3>
  {% if filtered_POST_items %}
    <table class="req">
      <thead>
        <tr>
          <th>Variable</th>
          <th>Value</th>
        </tr>
      </thead>
      <tbody>
        {% for k, v in filtered_POST_items %}
          <tr>
            <td>{{ k }}</td>
            <td class="code"><pre>{{ v|pprint }}</pre></td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  {% else %}
    <p>No POST data</p>
  {% endif %}
  <h3 id="files-info">FILES</h3>
  {% if request.FILES %}
    <table class="req">
        <thead>
            <tr>
                <th>Variable</th>
                <th>Value</th>
            </tr>
        </thead>
        <tbody>
            {% for k, v in request_FILES_items %}
                <tr>
                    <td>{{ k }}</td>
                    <td class="code"><pre>{{ v|pprint }}</pre></td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
  {% else %}
    <p>No FILES data</p>
  {% endif %}


  <h3 id="cookie-info">COOKIES</h3>
  {% if request.COOKIES %}
    <table class="req">
      <thead>
        <tr>
          <th>Variable</th>
          <th>Value</th>
        </tr>
      </thead>
      <tbody>
        {% for k, v in request_COOKIES_items %}
          <tr>
            <td>{{ k }}</td>
            <td class="code"><pre>{{ v|pprint }}</pre></td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  {% else %}
    <p>No cookie data</p>
  {% endif %}

  <h3 id="meta-info">META</h3>
  <table class="req">
    <thead>
      <tr>
        <th>Variable</th>
        <th>Value</th>
      </tr>
    </thead>
    <tbody>
      {% for var in request.META.items|dictsort:0 %}
        <tr>
          <td>{{ var.0 }}</td>
          <td class="code"><pre>{{ var.1|pprint }}</pre></td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% else %}
  <p>Request data not supplied</p>
{% endif %}

  <h3 id="settings-info">Settings</h3>
  <h4>Using settings module <code>{{ settings.SETTINGS_MODULE }}</code></h4>
  <table class="req">
    <thead>
      <tr>
        <th>Setting</th>
        <th>Value</th>
      </tr>
    </thead>
    <tbody>
      {% for var in settings.items|dictsort:0 %}
        <tr>
          <td>{{ var.0 }}</td>
          <td class="code"><pre>{{ var.1|pprint }}</pre></td>
        </tr>
      {% endfor %}
    </tbody>
  </table>

</div>
{% if not is_email %}
  <div id="explanation">
    <p>
      You're seeing this error because you have <code>DEBUG = True</code> in your
      Django settings file. Change that to <code>False</code>, and Django will
      display a standard page generated by the handler for this status code.
    </p>
  </div>
{% endif %}
</body>
</html>
u  {% firstof exception_type 'Report' %}{% if request %} at {{ request.path_info }}{% endif %}
{% firstof exception_value 'No exception message supplied' %}
{% if request %}
Request Method: {{ request.META.REQUEST_METHOD }}
Request URL: {{ request.get_raw_uri }}{% endif %}
Django Version: {{ django_version_info }}
Python Executable: {{ sys_executable }}
Python Version: {{ sys_version_info }}
Python Path: {{ sys_path }}
Server time: {{server_time|date:"r"}}
Installed Applications:
{{ settings.INSTALLED_APPS|pprint }}
Installed Middleware:
{% if settings.MIDDLEWARE is not None %}{{ settings.MIDDLEWARE|pprint }}{% else %}{{ settings.MIDDLEWARE_CLASSES|pprint }}{% endif %}
{% if template_does_not_exist %}Template loader postmortem
{% if postmortem %}Django tried loading these templates, in this order:
{% for entry in postmortem %}
Using engine {{ entry.backend.name }}:
{% if entry.tried %}{% for attempt in entry.tried %}    * {{ attempt.0.loader_name }}: {{ attempt.0.name }} ({{ attempt.1 }})
{% endfor %}{% else %}    This engine did not provide a list of tried templates.
{% endif %}{% endfor %}
{% else %}No templates were found because your 'TEMPLATES' setting is not configured.
{% endif %}
{% endif %}{% if template_info %}
Template error:
In template {{ template_info.name }}, error at line {{ template_info.line }}
   {{ template_info.message }}
{% for source_line in template_info.source_lines %}{% if source_line.0 == template_info.line %}   {{ source_line.0 }} : {{ template_info.before }} {{ template_info.during }} {{ template_info.after }}{% else %}   {{ source_line.0 }} : {{ source_line.1 }}{% endif %}{% endfor %}{% endif %}{% if frames %}

Traceback:{% for frame in frames %}{% ifchanged frame.exc_cause %}  {% if frame.exc_cause %}
    {% if frame.exc_cause_explicit %}
      The above exception ({{ frame.exc_cause }}) was the direct cause of the following exception:
    {% else %}
      During handling of the above exception ({{ frame.exc_cause }}), another exception occurred:
    {% endif %}
  {% endif %}
{% endifchanged %}
File "{{ frame.filename }}" in {{ frame.function }}
{% if frame.context_line %}  {{ frame.lineno }}. {{ frame.context_line }}{% endif %}
{% endfor %}
{% if exception_type %}Exception Type: {{ exception_type }}{% if request %} at {{ request.path_info }}{% endif %}
{% if exception_value %}Exception Value: {{ exception_value }}{% endif %}{% endif %}{% endif %}
{% if request %}Request information:
{% if user_str %}USER: {{ user_str }}{% endif %}

GET:{% for k, v in request_GET_items %}
{{ k }} = {{ v|stringformat:"r" }}{% empty %} No GET data{% endfor %}

POST:{% for k, v in filtered_POST_items %}
{{ k }} = {{ v|stringformat:"r" }}{% empty %} No POST data{% endfor %}

FILES:{% for k, v in request_FILES_items %}
{{ k }} = {{ v|stringformat:"r" }}{% empty %} No FILES data{% endfor %}

COOKIES:{% for k, v in request_COOKIES_items %}
{{ k }} = {{ v|stringformat:"r" }}{% empty %} No cookie data{% endfor %}

META:{% for k, v in request.META.items|dictsort:0 %}
{{ k }} = {{ v|stringformat:"r" }}{% endfor %}
{% else %}Request data not supplied
{% endif %}
Settings:
Using settings module {{ settings.SETTINGS_MODULE }}{% for k, v in settings.items|dictsort:0 %}
{{ k }} = {{ v|stringformat:"r" }}{% endfor %}

{% if not is_email %}
You're seeing this error because you have DEBUG = True in your
Django settings file. Change that to False, and Django will
display a standard page generated by the handler for this status code.
{% endif %}
u	  
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title>Page not found at {{ request.path_info|escape }}</title>
  <meta name="robots" content="NONE,NOARCHIVE">
  <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; }
    table { border:none; border-collapse: collapse; width:100%; }
    td, th { vertical-align:top; padding:2px 3px; }
    th { width:12em; text-align:right; color:#666; padding-right:.5em; }
    #info { background:#f6f6f6; }
    #info ol { margin: 0.5em 4em; }
    #info ol li { font-family: monospace; }
    #summary { background: #ffc; }
    #explanation { background:#eee; border-bottom: 0px none; }
  </style>
</head>
<body>
  <div id="summary">
    <h1>Page not found <span>(404)</span></h1>
    <table class="meta">
      <tr>
        <th>Request Method:</th>
        <td>{{ request.META.REQUEST_METHOD }}</td>
      </tr>
      <tr>
        <th>Request URL:</th>
        <td>{{ request.build_absolute_uri|escape }}</td>
      </tr>
      {% if raising_view_name %}
      <tr>
        <th>Raised by:</th>
        <td>{{ raising_view_name }}</td>
      </tr>
      {% endif %}
    </table>
  </div>
  <div id="info">
    {% if urlpatterns %}
      <p>
      Using the URLconf defined in <code>{{ urlconf }}</code>,
      Django tried these URL patterns, in this order:
      </p>
      <ol>
        {% for pattern in urlpatterns %}
          <li>
            {% for pat in pattern %}
                {{ pat.regex.pattern }}
                {% if forloop.last and pat.name %}[name='{{ pat.name }}']{% endif %}
            {% endfor %}
          </li>
        {% endfor %}
      </ol>
      <p>
        {% if request_path %}
        The current path, <code>{{ request_path|escape }}</code>,{% else %}
        The empty path{% endif %} didn't match any of these.
      </p>
    {% else %}
      <p>{{ reason }}</p>
    {% endif %}
  </div>

  <div id="explanation">
    <p>
      You're seeing this error because you have <code>DEBUG = True</code> in
      your Django settings file. Change that to <code>False</code>, and Django
      will display a standard 404 page.
    </p>
  </div>
</body>
</html>
u  
<!DOCTYPE html>
<html lang="en"><head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="robots" content="NONE,NOARCHIVE"><title>{{ title }}</title>
  <style type="text/css">
    html * { padding:0; margin:0; }
    body * { padding:10px 20px; }
    body * * { padding:0; }
    body { font:small sans-serif; }
    body>div { border-bottom:1px solid #ddd; }
    h1 { font-weight:normal; }
    h2 { margin-bottom:.8em; }
    h2 span { font-size:80%; color:#666; font-weight:normal; }
    h3 { margin:1em 0 .5em 0; }
    h4 { margin:0 0 .5em 0; font-weight: normal; }
    table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; }
    tbody td, tbody th { vertical-align:top; padding:2px 3px; }
    thead th {
      padding:1px 6px 1px 3px; background:#fefefe; text-align:left;
      font-weight:normal; font-size:11px; border:1px solid #ddd;
    }
    tbody th { width:12em; text-align:right; color:#666; padding-right:.5em; }
    #summary { background: #e0ebff; }
    #summary h2 { font-weight: normal; color: #666; }
    #explanation { background:#eee; }
    #instructions { background:#f6f6f6; }
    #summary table { border:none; background:transparent; }
  </style>
</head>

<body>
<div id="summary">
  <h1>{{ heading }}</h1>
  <h2>{{ subheading }}</h2>
</div>

<div id="instructions">
  <p>
    {{ instructions|safe }}
  </p>
</div>

<div id="explanation">
  <p>
    {{ explanation|safe }}
  </p>
</div>
</body></html>
(8   t
   __future__R    R   Ry   R   t   django.confR   t   django.httpR   R   t   django.templateR   R   R   t   django.template.defaultfiltersR   R   t   django.urlsR	   R
   t   django.utilsR   R   R   t   django.utils.datastructuresR   t   django.utils.encodingR   R   t   django.utils.module_loadingR   t   django.utils.translationR   R   Rk   R   t   compilet
   IGNORECASER#   R%   t   objectR   R   R2   RA   RC   RE   RF   RN   R5   R   R   R   R   R   R   (    (    (    s<   /usr/local/lib/python2.7/dist-packages/django/views/debug.pyt   <module>   sB   				w	7	  3