I want my users to access a specific location of my API using either the English word "series" or the French equivalent "séries" as an argument in the URL. The URL and subsequent extensions will be reversed to using the English word. Here is my first attempt:
urlpatterns = [
path(r"series/", include("series.public_urls", namespace="series")),
path(r"séries/", include("series.public_urls")),
]
Despite the following warning, I have been able to reverse all my URLs so far:
?: (urls.W005) URL namespace 'series' isn't unique. You may not be able to reverse all URLs in this namespace
However a warning is a foreboding of impending doom and I'm looking for another solution. I've tried using Regex paths:
urlpatterns = [
re_path(r"s(e|é)ries/", include("series.public_urls", namespace="series")),
]
This throws an ImproperlyConfigured
error. I understand the reverser cannot handle the "or" matching control but needs to know which of e or é it should reverse to.
How can I allow reversing to "series" solely within this very urls.py
file?