In the template (html file):
```{% url 'post_list' category=category %}```
In the urls.py file:
```urlpatterns = [ path('posts/<str:category>/', post_list,
name='post_list'), ]```
Now if you pass a {"category": "something/"} to the render functionality,
it will fail with a no reverse match, this is because, in the views, the
matcher for anything passed in the urls cannot contain a slash, for
instance, <str:category> will not match if it contains a slash
To solve this issue, I recommend enconding the slash as %2F
--
Ticket URL: <https://code.djangoproject.com/ticket/33499>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => wontfix
Comment:
Hi Antônio...
> if you pass a `{"category": "something/"}`
I think we'd just put this down to wrong usage no? The URL `path` pattern
provides the trailing `/`, so passing it as part of the parameter is not
intended. (If you really want `something%2F`, I think you need to pass
that yourself.)
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/33499#comment:1>
* type: Uncategorized => New feature
--
Ticket URL: <https://code.djangoproject.com/ticket/33499#comment:2>