问题
Is it possible to get an specific parameter in a url and use it in a template ?
`{{ request.path }}
It gets the whole url, i need only the 'pk' parameter, to make a link to another page.
Thanks.
回答1:
I did some experiments and find that this may help:
{{ request.resolver_match.kwargs.pk }}
For more info you can check this.
来源:https://stackoverflow.com/questions/40797746/how-to-get-parameters-from-current-url