datatracker
datatracker copied to clipboard
Split url() wrapper in urls.py into path() / re_path()
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
- [X] I agree to follow the IETF's Code of Conduct