Ugh, sorry for having created this confusion, I made the comment yesterday during my commute hence the brevity.
What I was thinking was indeed using a class attribute for such a configuration value because it could be overwritten on a per project basis if needed. I’m aware of that we have willfully punted on that last winter while discussing the app-loading refactor.
I was think something along the lines of this:
# django/contrib/staticfiles/apps.py
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class StaticFilesConfig(AppConfig):
name = 'django.contrib.staticfiles'
verbose_name = _("Static Files")
ignore_patterns = ['CVS', '.*', '*~'] # <-- new line
# acme/apps.py
from django.contrib.staticfiles.apps import StaticFilesConfig
class AcmeStaticFilesConfig(StaticFilesConfig):
ignore_patterns = (StaticFilesConfig.ignore_patterns +
[‘vendor/*', ‘endless_pit/*'])
# acme/settings.py
INSTALLED_APPS = [
'acme.apps.AcmeStaticFilesConfig',
]
# django/contrib/staticfiles/management/commands/collectstatic.py
from django.apps import apps
class Command(BaseCommand):
# ...
def set_options(self, **options):
# ...
staticfiles_config = apps.get_app_config('staticfiles')
self.ignore_patterns = staticfiles_config.ignore_patterns <-- new line
I hope I’m not missing something. I guess this would only work once the app registry is populated, but isn’t that the case when the management command is called anyway?
Jannis