o
    hTte                     @  sR   d Z ddlmZ ddlmZ ddlmZ dd Zdd Ze Z	G d	d
 d
e	Z
dS )aZ  
Subclass the existing 'runserver' command and change the default options
to disable static file serving, allowing WhiteNoise to handle static files.

There is some unpleasant hackery here because we don't know which command class
to subclass until runtime as it depends on which INSTALLED_APPS we have, so we
have to determine this dynamically.
    )annotations)import_module)appsc               
   C  s>   t  D ]} d|  }zt|jW   S  ttfy   Y qw dS )zD
    Return the next highest priority "runserver" command class
    z %s.management.commands.runserverN)get_lower_priority_appsr   CommandImportErrorAttributeError)app_namemodule_path r   /var/www/social.2tendo.club/virtuCedar/venv/lib/python3.10/site-packages/whitenoise/runserver_nostatic/management/commands/runserver.pyget_next_runserver_command   s   
r   c                  c  sR    d tddd } d}t D ]}|j| krd}q|r#|jV  qdV  dS )zU
    Yield all app module names below the current app in the INSTALLED_APPS list
    .NFTzdjango.core)join__name__splitr   get_app_configsname)self_app_namereached_self
app_configr   r   r   r      s   

r   c                      s   e Zd Z fddZ  ZS )r   c                   s<   t  | |ddu r|jdd | jd7  _d S d S )Nuse_static_handlerTF)r   zK
(Wrapped by 'whitenoise.runserver_nostatic' to always enable '--nostatic'))superadd_argumentsget_defaultset_defaultsdescription)selfparser	__class__r   r   r   .   s   
zCommand.add_arguments)r   
__module____qualname__r   __classcell__r   r   r    r   r   -   s    r   N)__doc__
__future__r   	importlibr   django.appsr   r   r   RunserverCommandr   r   r   r   r   <module>   s    