I'm using external application called foo
which I mostly like, but I need to extend functionality of one specific view called Bar
. Normally, I'd just put my extended view in urls.py
before include('foo.urls')
and name it the same, so that resolver hits it first:
urlpatterns = [
...
url(r'^foo/path_to_bar$', CustomBar.as_view(), name='bar'),
url(r'^foo/$', include('foo.urls')),
...
]
The problem is, foo
uses namespaced urls everywhere, so the view in question is actually referred to by foo:bar
and the include()
declaration above should actually be:
include('foo.urls', namespace='foo', app_name='foo')
This is apparently great for resuable apps, but I have hard time finding the way to override this view in my project. Are there any means to do so, without rewriting all calls to reverse()
and uses of {% url %}
in foo
? That would esentially amount to forking the app and defeat the purpose of reusing a view in the first place.