Could we make a decision on this one? I’d like to provide a resolution to the original author and in the PR.
There is a valid point in that a Django app without urls.py
is completely valid, but I also agree with the counterargument that we are shipping the default app template with a views.py
file which, following the recommended best practices, should be accompanied by a urls.py
exposing the app-specific urls served by those views. So, in summary, it feels inconsistent to create a views.py
by default and not an per-app urls.py
.
Is also worth noting that existing tutorials and docs stating “…and then you should create a per-app urls.py
file” would not need immediate fixing since people following the tutorials would find out that the file is already there and with a minimal (and useful) skeleton, so there shouldn’t be any surprises or confusion.
@tom to your point of “But I think it’s more likely they still would have been confused.”, and adding to what @czue already said, I’m confident that new comers would be less surprised by the file being there (based on teaching experience), but also, having the urls.py
next to views.py
would, if anything by using it mechanically, enforce the desired patterns for app isolation.
I personally think that the presented rationale (from the author and others in this thread) is strong enough to pursue this proposal, but since what is consensus is currently being (re)discussed and we have no concrete conclusion yet, ideally I’d like us all to reach a collective decision before proceeding any further (even if the decision is to not do this at this time).
Thank you!