datatracker icon indicating copy to clipboard operation
datatracker copied to clipboard

Split url() wrapper in urls.py into path() / re_path()

Open jennifer-richards opened this issue 7 months ago • 0 comments

Description

URL routings for the datatracker are defined using ietf.utils.urls.url() in the various urls.py files. This was a wrapper around Django's long-deprecated url() method (deprecated in Django 3.1, removed in Django 4.0). It has been updated to use re_path(), which is what Django's url() method did.

We should split this wrapper into path() and re_path() variants so that routes not using regexps can use the simpler method. This will also make the codebase more compatible with standard Django usage.

I think much of the code in our current url() function could be cleaned up. As far as I can tell, there are a couple of branches that actually do anything and the rest is just there for debugging. I didn't touch it when refactoring for the Django 4 upgrade for fear of breaking something magic, but we should try to understand exactly what's going on and improve the code when refactoring it further.

Code of Conduct

jennifer-richards avatar Jul 02 '24 15:07 jennifer-richards