
vÅÏ^&  ã               @   sJ   d  d l  m Z d  d l m Z d  d l m Z Gd d „  d e ƒ Z d S)é    )Úsettings)ÚStaticFilesHandler)ÚCommandc                   s:   e  Z d  Z d Z ‡  f d d †  Z ‡  f d d †  Z ‡  S)r   zMStarts a lightweight Web server for development and also serves static files.c                sR   t  ƒ  j | ƒ | j d d d d d d d ƒ| j d d d	 d d
 d d ƒd  S)Nz
--nostaticÚactionÚstore_falseÚdestÚuse_static_handlerÚhelpzCTells Django to NOT automatically serve static files at STATIC_URL.z
--insecureÚ
store_trueÚinsecure_servingz3Allows serving static files even if DEBUG is False.)ÚsuperÚadd_argumentsÚadd_argument)ÚselfÚparser)Ú	__class__© úZ/tmp/pip-build-8lau8j11/django/django/contrib/staticfiles/management/commands/runserver.pyr      s    zCommand.add_argumentsc                sL   t  ƒ  j | | Ž  } | d } | d } | rH t j s> | rH t | ƒ S| S)z§
        Return the static files serving handler wrapping the default handler,
        if static files should be served. Otherwise return the default handler.
        r   r   )r   Úget_handlerr   ÚDEBUGr   )r   ÚargsÚoptionsÚhandlerr   r   )r   r   r   r      s    


zCommand.get_handler)Ú__name__Ú
__module__Ú__qualname__r	   r   r   r   r   )r   r   r      s   r   N)Zdjango.confr   Z#django.contrib.staticfiles.handlersr   Z)django.core.management.commands.runserverr   ZRunserverCommandr   r   r   r   Ú<module>   s   