In some of my projects I need more than this, and the only way to get that
behavior is to remember the command line options and patterns. Working on
many different projects all the time, this is problematic for me.
I'd like to propose a settings file addition that would pull those ignore
patterns from settings.COLLECT_STATIC_IGNORE or something similar.
I'd be willing to write the code if this is accepted. We could leave the
default alone, but allow people to put various things in the list to make
deployment less of a hassle.
Part of the issues for me include sass files, themes associated with sass
files, "uncompiled" javascript that needs to be served on debug, but does
not need to be in the production static folder.
--
Ticket URL: <https://code.djangoproject.com/ticket/20189>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Hi,
This is the file that the code is in
https://github.com/django/django/blob/master/django/contrib/staticfiles/management/commands/collectstatic.py
This seems like a cool feature to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:2>
* cc: tomas.ehrlich@… (added)
* has_patch: 0 => 1
* version: 1.5 => master
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:3>
Comment (by Elvard):
I've added STATICFILES_IGNORE_PATTERNS setting. Implementation was mostly
straightforward. The only problem is backward compatibility.
The default value of STATICFILES_IGNORE_PATTERNS is ['CVS', '.*', '*~'],
the same as default patterns hard-coded in management command. When user
passes --no-default-ignore option, these default patterns are substracted
and deprecation warning raised.
Need review for this, also for docs. Tests passed.
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:4>
* needs_better_patch: 0 => 1
Comment:
We try to avoid new settings at all costs, although I don't have any
alternate suggestions in this case. Anyway, the patch needs to be updated.
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:5>
* needs_better_patch: 1 => 0
Comment:
Patch updated, see PR https://github.com/django/django/pull/2854
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:6>
* needs_better_patch: 0 => 1
Comment:
This is simple, don't add a global setting but a parameter to the
staticfile app config. That's where such things belong now.
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:7>
* needs_better_patch: 1 => 0
Comment:
Tried to provide a new [https://github.com/django/django/pull/6460 PR]
with the app config way.
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"f4c2b8e04a297f627a8e722d78eda6cbf5cc8a6e" f4c2b8e]:
{{{
#!CommitTicketReference repository=""
revision="f4c2b8e04a297f627a8e722d78eda6cbf5cc8a6e"
Fixed #20189 -- Allowed customizing staticfiles ignored_patterns list
Thanks Tim Graham for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20189#comment:10>