
TQc           @   s   d  Z  d   Z d S(   s  
Pages in Django can are served up with custom HTTP headers containing useful
information about those pages -- namely, the content type and object ID.

This module contains utility functions for retrieving and doing interesting
things with these special "X-Headers" (so called because the HTTP spec demands
that custom headers are prefixed with "X-").

Next time you're at slashdot.org, watch out for X-Fry and X-Bender. :)
c         C   s   d d l  m } |  j j d  | j k sR t |  d  r |  j j r |  j j r d | j	 j
 | j	 j j   f | d <t |  | d <n  d S(	   s  
    Adds the "X-Object-Type" and "X-Object-Id" headers to the given
    HttpResponse according to the given model and object_id -- but only if the
    given HttpRequest object has an IP address within the INTERNAL_IPS setting
    or if the request is from a logged in staff member.
    i(   t   settingst   REMOTE_ADDRt   users   %s.%ss   X-Object-Types   X-Object-IdN(   t   django.confR    t   METAt   gett   INTERNAL_IPSt   hasattrR   t	   is_activet   is_stafft   _metat	   app_labelt   object_namet   lowert   str(   t   requestt   responset   modelt	   object_idR    (    (    s-   ../Django//lib/python/django/core/xheaders.pyt   populate_xheaders   s    &N(   t   __doc__R   (    (    (    s-   ../Django//lib/python/django/core/xheaders.pyt   <module>
   s   