Skip to content

Rewrite translated URLs #59

@adamchainz

Description

@adamchainz

It's theoretically possible to rewrite old url() calls using translation to the new path format, e.g.

-from django.conf.urls import url
+from django.urls import re_path
 from django.utils.translation import gettext_lazy as _

-url(_(r'^about/$'), views.about)
+path(_(r'about/'), views.about)

State.from_imports would need extending to track aliases as it currently ignores them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions