python - How to call collectstatic management command programatically using call_command with options like -l or --noinput -


i trying call collectstatic command usig call_command when want use option -l or --noinput

django.core.management.call_command('collectstatic','--noinput') 

its giving me error

commanderror: command doesn't accept arguments 

please let me know how can call this, how pass options.

thanks in advance

this covered in django's official documentation: (https://docs.djangoproject.com/en/1.8/ref/django-admin/#running-management-commands-from-your-code) proper way call command should be:

from django.core.management import call_command  call_command('collectstatic', verbosity=0, interactive=false)