Fully decoupled URLconf's for apps.
|Reported by:||sa@…||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In part 3 of the tutorial you introduce a way to decouple the URLconfs.
But unless I'm missing something there's still one thing left that is tied to the project, namely the prefix passed to the patterns() function.
urlpatterns = patterns('myproject.apps.polls.views.polls', (r'^$', 'index'), (r'^(?P<poll_id>\d+)/$', 'detail'), (r'^(?P<poll_id>\d+)/results/$', 'results'), (r'^(?P<poll_id>\d+)/vote/$', 'vote'), )
The attached patch eliminates the need to pass in the prefix and let's the patterns() function figure that out by itself. Pass None instead of the prefix to trigger the "figure-out-the-prefix-by-yourself" functionality.
urlpatterns = patterns(None, ... )
Hope that's usefull for someone.