3
™(ƒh1  ã               @   s^   d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	d
„ZdS )zŽ
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.

é    N)Úsettings)Úfinders)ÚHttp404)Úunquote)ÚstaticFc             K   s‚   t j r| rt‚tjt|ƒƒjdƒ}tj|ƒ}|sZ|j	dƒsF|dkrNtdƒ‚td| ƒ‚t
jj|ƒ\}}tj| |fd|i|—ŽS )av  
    Serve static files below a given point in the directory structure or
    from locations inferred from the staticfiles finders.

    To use, put a URL pattern such as::

        from django.contrib.staticfiles import views

        url(r'^(?P<path>.*)$', views.serve)

    in your URLconf.

    It uses the django.views.static.serve() view to serve the found files.
    ú/Ú z'Directory indexes are not allowed here.z'%s' could not be foundÚdocument_root)r   ÚDEBUGr   Ú	posixpathÚnormpathr   Úlstripr   ÚfindÚendswithÚosÚpathÚsplitr   Úserve)Úrequestr   ZinsecureÚkwargsZnormalized_pathZabsolute_pathr	   © r   úD/tmp/pip-install-q3hcpn_q/Django/django/contrib/staticfiles/views.pyr      s    
r   )F)Ú__doc__r   r   Zdjango.confr   Zdjango.contrib.staticfilesr   Zdjango.httpr   Z#django.utils.six.moves.urllib.parser   Zdjango.viewsr   r   r   r   r   r   Ú<module>   s   