1

when I run this code

python manage.py collectstatic --clear --noinput

it remove all static files and folders in staticroot and colletc all files and folders again. But I want to collect just a specific file or a specific folder. How can i do that?

1 Answers1

8

collectstatic doesn't support whitelists, all it supports is blacklists (ignoring file patterns), so you will have to list everything you don't want to be synced:

python manage.py collectstatic -i folder1 -i *.jpeg
serg
  • 109,619
  • 77
  • 317
  • 330
  • 1
    @GuilhermeIA the `-i` flag means 'ignore' so it will ignore things in `folder1/` and files ending in `.jpeg` – Eric Blum Feb 27 '18 at 22:10