Re: final_catch_all_view

2021-01-19 Thread אורי
Hi Adam, I think it's better not to rely on the number of "catch all" urlpatterns to be 1. I suggest it's better to separate *AdminSite.get_urls* into 3 functions - one returning all urls like before (without the "catch all" urlpattern), one returning a list containing only the "catch all" urlpatt

Re: final_catch_all_view

2021-01-19 Thread Carlton Gibson
Hey Uri, The “not recommended” amounts to a trade-off: adjust your URL patterns (Adam’s approach looks good if you really must insert them after the admin URLs) or allow a potential leakage of what model exist to someone probing the site. Turning off the catch-all view potentially allows the latt

Re: final_catch_all_view

2021-01-19 Thread Adam Johnson
I don't see the need for any change - you can insert your custom URL's before the catch-all view with a subclass of AdminSite like so: class MyAdminSite(AdminSite): def get_urls(self): urls = super().get_urls() return urls[:-1] + [ # custom urls ...