Ticket #20189: ticket-20189.patch

File ticket-20189.patch, 3.6 KB (added by Tomáš Ehrlich, 11 years ago)

Added STATICFILES_IGNORE_PATTERNS to settings.

  • django/conf/global_settings.py

    diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
    index 19258fb..f055c56 100644
    a b STATICFILES_FINDERS = (  
    603603    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    604604#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
    605605)
     606
     607STATICFILES_IGNORE_PATTERNS = ['CVS', '.*', '*~']
  • django/contrib/staticfiles/management/commands/collectstatic.py

    diff --git a/django/contrib/staticfiles/management/commands/collectstatic.py b/django/contrib/staticfiles/management/commands/collectstatic.py
    index 7c3de80..304c676 100644
    a b from __future__ import unicode_literals  
    22
    33import os
    44import sys
     5import warnings
    56from optparse import make_option
    67
     8from django.conf import settings
    79from django.core.files.storage import FileSystemStorage
    810from django.core.management.base import CommandError, NoArgsCommand
    911from django.utils.encoding import smart_text
    class Command(NoArgsCommand):  
    7072        self.symlink = options['link']
    7173        self.clear = options['clear']
    7274        self.dry_run = options['dry_run']
    73         ignore_patterns = options['ignore_patterns']
    74         if options['use_default_ignore_patterns']:
    75             ignore_patterns += ['CVS', '.*', '*~']
     75
     76        ignore_patterns = settings.STATICFILES_IGNORE_PATTERNS
     77        ignore_patterns.extend(options['ignore_patterns'])
     78        if not options['use_default_ignore_patterns']:
     79            # Hard-coded patterns which were default before
     80            ignore_patterns = set(ignore_patterns) - set(['CVS', '.*', '*~'])
     81            warnings.warn("--no-default-ignore option will be ignored in"
     82                          " future. Please override STATICFILES_IGNORE_PATTERS"
     83                          " if you don't want to use default patterns.",
     84                          PendingDeprecationWarning)
    7685        self.ignore_patterns = list(set(ignore_patterns))
    7786        self.post_process = options['post_process']
    7887
  • docs/ref/contrib/staticfiles.txt

    diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt
    index 806d135..6e98bc2 100644
    a b following settings:  
    2626* :setting:`STATIC_ROOT`
    2727* :setting:`STATIC_URL`
    2828* :setting:`STATICFILES_DIRS`
     29* :setting:`STATICFILES_IGNORE_PATTERNS`
    2930* :setting:`STATICFILES_STORAGE`
    3031* :setting:`STATICFILES_FINDERS`
    3132
    Some commonly used options are:  
    99100    Don't ignore the common private glob-style patterns ``'CVS'``, ``'.*'``
    100101    and ``'*~'``.
    101102
     103    .. versionchanged:: 1.7
     104
     105    This option is deprecated and will be ignored in future. Please set
     106    :setting:`STATICFILES_IGNORE_PATTERNS` instead.
     107
    102108For a full list of options, refer to the commands own help by running::
    103109
    104110   $ python manage.py collectstatic --help
  • docs/ref/settings.txt

    diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
    index c970311..e606420 100644
    a b This would allow you to refer to the local file  
    25472547
    25482548    <a href="{{ STATIC_URL }}downloads/polls_20101022.tar.gz">
    25492549
     2550.. setting:: STATICFILES_IGNORE_PATTERNS
     2551
     2552STATICFILES_IGNORE_PATTERNS
     2553---------------------------
     2554
     2555.. versionadded:: 1.7
     2556
     2557Default: ``['CVS', '.*', '*~']``
     2558
     2559List of file patterns which will be ignored when collecting static files with
     2560the :djadmin:`collectstatic` management command.
     2561
     2562This list can be further extended with command line option ``-i``.
     2563
    25502564.. setting:: STATICFILES_STORAGE
    25512565
    25522566STATICFILES_STORAGE
Back to Top