Django collectstatic命令用于特定文件或文件夹

Django collectstatic命令用于特定文件或文件夹,django,static,root,collectstatic,Django,Static,Root,Collectstatic,当我运行此代码时 python manage.py collectstatic --clear --noinput 它将删除staticroot中的所有静态文件和文件夹,并再次收集所有文件和文件夹。但我只想收集一个特定的文件或文件夹。我该怎么做?collectstatic不支持白名单,它只支持忽略文件模式的黑名单,因此您必须列出所有不希望同步的内容: python manage.py collectstatic -i folder1 -i *.jpeg collectstatic不支持白名单

当我运行此代码时

python manage.py collectstatic --clear --noinput
它将删除staticroot中的所有静态文件和文件夹,并再次收集所有文件和文件夹。但我只想收集一个特定的文件或文件夹。我该怎么做?

collectstatic不支持白名单,它只支持忽略文件模式的黑名单,因此您必须列出所有不希望同步的内容:

python manage.py collectstatic -i folder1 -i *.jpeg
collectstatic不支持白名单,它只支持忽略文件模式的黑名单,因此您必须列出所有不希望同步的内容:

python manage.py collectstatic -i folder1 -i *.jpeg
为什么需要使用-clear?为什么需要使用-clear?@guilhermia-i标志表示“忽略”,因此它将忽略folder1/和以结尾的文件中的内容。jpeg@GuilhermeIAi标志表示“忽略”,因此它将忽略folder1/和以.jpeg结尾的文件中的内容