Skip to content

Replace re_path with path where possible in urls.py #3515

@hmpf

Description

@hmpf

NAV has tons of re_path since it is a rename from the old way of doing urls in django, using the url function. It was a seddable fix.

However, modern django also has path, which is not written as a regular expression but has its own syntax, covering the most common cases. It is possible to autoconvert some re_paths to path but of course, NAV has some oddities. also some that cannot be handled with path-syntax at all.

See https://docs.djangoproject.com/en/4.2/ref/urls/ for docs.

This issue is for collecting PRs that only change re_path to path, merged to the branch path-instead-of-repath. Multiple PR's because otherwise not only making these PR's but also reviewing the PR's would be a snore-inducing, eye-strain-creating chore.

If you need a chore, pick an urls.py or five that haven't been converted yet, claim it as yours by importing path in it (or some other miniscule change if path is already there), and make a draft PR with just that commit. Then you can convert at your leisure.

Each PR will finish at least one urls.py as much as possible, and we will not add any new path-syntax here, that's for #3548.

Metadata

Metadata

Assignees

No one assigned

    Labels

    METAI contain multitudes

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions