I’ll take that as an invitation to sway you.
First, I tend to agree that if the urls.py
had been there in the first place they wouldn’t have asked. I have seen so many tutorials (including Django’s own) which are like "ok run startapp
and then add a urls.py
file). This to me is a very clear signal that the file should already be there! And I suspect (and obviously we’re all speculating) that at least part of the confusion stems from the fact that the startapp
command doesn’t include it.
Second, and I think more importantly, there are two important and sometimes competing goals when helping beginners. The first is reducing confusion, which we all agree is important. And if it were true that including a urls.py
file was net-confusion-increasing (which I disagree it is) then that would at least be a good reason to be against it. However, the second goal of helping beginners is teaching them how to be successful in the framework. That is, ramping up on common/best practices, understanding how apps are put together, etc. And towards that second goal I think it is very clearly net positive to teach people that it is a good/common practice to include an app-specific urls.py
file when that app has its own views. The built-in tutorial agrees. The django-girls tutorial agrees. The simple is better than complex tutorial agrees. The channels tutorial agrees. The youtube tutorial that you mentioned on Discord agrees. And in fact, I would be impressed if anyone is able to find any recent, highly recommended Django resource that does not add an app-specific urls.py
file.
So quite literally everyone is already doing this. But we don’t want to just make it the default because… ?