def collect_static ( ) -> bool : from django . core . management import execute_from_command_line # from django.conf import settings # if not os.listdir(settings.STATIC_ROOT): wf ( 'Collecting static files... ' , False ) execute_from_command_line ( [ './manage.py' , 'collectstatic' , '-c' , '--noinput' , '-v0' ] ) wf ( '[+]\n' ) return True
python django name 'static' is not defined
Runs Django collectstatic command in silent mode .
def collect_static() -> bool:
    """
    Runs Django ``collectstatic`` command in silent mode.

    :return: always ``True``
    """
    from django.core.management import execute_from_command_line
    # from django.conf import settings
    # if not os.listdir(settings.STATIC_ROOT):
    wf('Collecting static files... ', False)
    execute_from_command_line(['./manage.py', 'collectstatic', '-c', '--noinput', '-v0'])
    wf('[+]\n')
    return True