I am using Django and I have the following URL in my project's urls.py file.
(r'^user/(?P<username>[\w_\-\.]+)/my_app/', include('my_app.urls')),
(r'^user/(?P<username>[\w_\-\.]+)/my_other_app/', include('my_other_app.urls')),
...
The goal is to have an application that uses the username of a user e.g. a profile application where every user has a profile page. Only one view in this application needs to have the username in the URL (the one that renders the profile page), but all the views must take a username
parameter even if they don't do anything with it.
I suspect that this usage of URL parameters is wrong because it forces every view of my_app
to take username as a parameter (because it's passed as from the URL dispatcher). To me it doesn't make sense for an external component (the project's urls.py file) to tell my_app
's URLs what parameters to take.
Is this usage correct? If not, how should I do this?