How to ignore directories when running Django collectstatic? How to ignore directories when running Django collectstatic? python python

How to ignore directories when running Django collectstatic?


Don't write full path of directories. For example usage:

python manage.py collectstatic --noinput -i admin

This command won't copy the admin/ directory to STATIC_ROOT path.


The Django 2.2 release has finally addressed the very longstanding issue of specifying ignore parameters with path matching, for example

manage.py collectstatic --ignore /vendor/*.js

should then work.