I've written some possible approaches in the
[https://groups.google.com/u/1/g/django-
developers/c/7ixiIzn7DDg/m/QckEjbFCAwAJ mailing list discussion].
--
Ticket URL: <https://code.djangoproject.com/ticket/32309>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by sage):
[https://github.com/django/django/pull/13827 POC with a new --directory
option]. I chose this one because the implementation is pretty similar to
`--name`. Suggestions welcome.
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:1>
Comment (by Florian Apolloner):
Personally I find it counter-intuitive to add
`--extension/--file/--directory` to properly render a template. Imo it
would make more sense if templates could provide a `.json/.ini`
(whatever) file which would tell Django what to render…
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:2>
* stage: Unreviewed => Accepted
Comment:
This was part of the original patch in
a9a0f0b03f9a02deb03617bf7e9773a307d1328f for #17042. That was a while ago.
Having `.` dirs/files perhaps wasn't so common then as now.
René on the list:
> I think I prefer explicit exclusion by the user (except for obvious
> cases like .git and __pycache__) because it's less surprising.
I think we could take that as a smaller (quicker?) way to address this
issue, allowing a follow-up if someone wants it with Florian's suggest to
add a config file to encode options.
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:3>
Comment (by sage):
> I think we could take that as a smaller (quicker?) way to address this
issue,
> allowing a follow-up if someone wants it with Florian's suggest
> to add a config file to encode options.
I've changed the PR to add an `--exclude` (`-x`) option instead, with
`.git` and `__pycache__` always excluded.
I can add docs and tests if the approach is good to go.
I know it's probably too late to hit the feature freeze for 3.2... but if
there's still time to push this in and I'm not around, feel free to pick
this up =)
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:4>
* needs_docs: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1
Comment:
Thanks for this, I think with positive reactions from Carlton and René
this is ready for a review once some docs and tests are included, so yes,
good to go.
[https://github.com/django/django/pull/13827 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:5>
* needs_docs: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:6>
Comment (by Chris Jerdonek):
Should including hidden directories be opt-in for backwards compatibility
reasons, since they're currently excluded? If the change automatically
includes them, it seems like there should be some kind of release note
letting users know. It seems like a safer change might be to keep the
current default the same.
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:7>
* needs_better_patch: 0 => 1
Comment:
Replying to [comment:7 Chris Jerdonek]:
> Should including hidden directories be opt-in for backwards
compatibility reasons, since they're currently excluded? If the change
automatically includes them, it seems like there should be some kind of
release note letting users know. It seems like a safer change might be to
keep the current default the same.
Agreed. We could keep the current behavior if the `exclude` argument is
not passed.
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:8>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:9>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:10>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"84c7c4a477eae5de394d036d7ba1e58a37e18b69" 84c7c4a4]:
{{{
#!CommitTicketReference repository=""
revision="84c7c4a477eae5de394d036d7ba1e58a37e18b69"
Fixed #32309 -- Added --exclude option to startapp/startproject management
commands.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:12>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"3686077d463685d383e14b4695eaaa2658919a42" 3686077d]:
{{{
#!CommitTicketReference repository=""
revision="3686077d463685d383e14b4695eaaa2658919a42"
Refs #32309 -- Added test for excluding hidden directories in startproject
command.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32309#comment:11>