I'm writing a page that takes an id and finds a user that matches that id. this is the URL pattern that I wrote in urls.py:
re_path(r'^users/id=(?P<username>[0-9]{9})$' , views.usershow , name = 'usershow') ,
I want to pass username using forms and so I wrote this in templates:
<form action="{% url 'CMS:usershow' %}" method="GET" >
{% csrf_token %}
<input name="id" type="number" placeholder="search">
<button type="submit">find</button>
</form>
but it shows me this error :
Reverse for 'usershow' with no arguments not found. 1 pattern(s) tried: ['dashboard/users/id=(?P<username>[0-9]{9})$']
How can I pass it using forms with this URL pattern?
{% csrf_token %}when your form method isGET? I think not.