`collectstatic --ignore` pattern matching

633 views
Skip to first unread message

Eric Eldredge

unread,
Jan 27, 2014, 5:54:29 PM1/27/14
to django-d...@googlegroups.com
Hi all,

I'm working on a project where I want to ignore certain files when running collectstatic.

I am having success only when i use 'basename' patterns, such as *.exe or vendor, but not when trying to match file paths, such as vendor/*.exe.

It seems the reason i'm not seeing the behavior i expect is because django.contrib.staticfiles.utils.get_files only checks the ignore patterns on the base names (for both files and directories), but does not check the full file path.

Is this the correct behavior, or a bug? If it is the correct behavior, what is the recommended approach for gaining more fine-grained control over what is collected by collectstatic?

Thanks in advance for any consideration.

Shimul Taleb

unread,
Sep 18, 2015, 2:00:17 PM9/18/15
to Django developers (Contributions to Django itself)
Django use this `get_fiels` function to get all files, folders name  list https://github.com/django/django/blob/master/django/contrib/staticfiles/utils.py#L21 
So it does not have any knowledge about path.
Reply all
Reply to author
Forward
0 new messages