3
(hi                 @   s8   d dl mZ d dlmZ d dlmZ G dd deZdS )    )settings)StaticFilesHandler)Commandc                   s,   e Zd ZdZ fddZ fddZ  ZS )r   zMStarts a lightweight Web server for development and also serves static files.c                s<   t t| j| |jdddddd |jddd	d
dd d S )Nz
--nostaticstore_falseuse_static_handlerTzCTells Django to NOT automatically serve static files at STATIC_URL.)actiondestdefaulthelpz
--insecure
store_trueinsecure_servingFz3Allows serving static files even if DEBUG is False.)superr   add_argumentsadd_argument)selfparser)	__class__ \/tmp/pip-install-q3hcpn_q/Django/django/contrib/staticfiles/management/commands/runserver.pyr   
   s    zCommand.add_argumentsc                s<   t t| j||}|d }|d }|r8tjs0|r8t|S |S )z
        Returns the static files serving handler wrapping the default handler,
        if static files should be served. Otherwise just returns the default
        handler.
        r   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   __classcell__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   