From f4c2b8e04a297f627a8e722d78eda6cbf5cc8a6e Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 15 Apr 2016 21:05:06 +0200 Subject: Fixed #20189 -- Allowed customizing staticfiles ignored_patterns list Thanks Tim Graham for the review. --- docs/ref/contrib/staticfiles.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docs') diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt index e09bdaad49..3e70d82f7e 100644 --- a/docs/ref/contrib/staticfiles.txt +++ b/docs/ref/contrib/staticfiles.txt @@ -128,6 +128,24 @@ For a full list of options, refer to the commands own help by running:: $ python manage.py collectstatic --help +Customizing the ignored pattern list +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 1.10 + +The default ignored pattern list, ``['CVS', '.*', '*~']``, can be customized in +a more persistent way than providing the ``--ignore`` command option at each +``collectstatic`` invocation. Provide a custom :class:`~django.apps.AppConfig` +class, override the ``ignore_patterns`` attribute of this class and specify +that class path inside your :setting:`INSTALLED_APPS` setting: + +.. code-block:: python + + from django.contrib.staticfiles.apps import StaticFilesConfig + + class MyStaticFilesConfig(StaticFilesConfig): + ignore_patterns = [...] # your custom ignore list + ``findstatic`` -------------- -- cgit v1.3