Hi,
I'm trying to convert my website from using re_path to path. I have a URL
https://en.speedy.net/about/ , and if the user types any URL which starts
with /about/, such as https://en.speedy.net/about/1/ - he is redirected to
https://en.speedy.net/about/ .
In urls.py I have:
re_path(route=r'^about/', view=include('speedy.core.about.urls', namespace=
'about')),
And in about/urls.py:
re_path(route=r'', view=views.AboutView.as_view(), name='about'),
The view handles the redirect if necessary.
Now, I changed urls.py to:
path(route='about/', view=include('speedy.core.about.urls', namespace='about')),
And about/urls.py to:
path(route='<path:rest>', view=views.AboutView.as_view(), name='about'),
But, if the user enters /about/1/, he is redirected to /about/, but then I
receive error 404. What is the problem and how should I define it? I prefer
not to have to use <path:rest> but catch any url which starts with /about/ .
Thanks,
Uri.
אורי
[email protected]
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CABD5YeETsfwLTtQ4%2BGzJrzJ4gbVvfUwBFD7wFPTB9dbikw%3DaNw%40mail.gmail.com.