string parameter passing not working in django1.9
<p>I am passing a string parameter in view but its not working.</p>

<pre><code>url(r'^users/(?P&lt;user_type&gt;\w+)/$', views.users, name='users'),
url(r'^users/$', views.users, name='users')
</code></pre>

<p><strong>view is:-</strong> </p>

<pre><code>def users(request, user_type=None):
</code></pre>

<p><strong>Link is:-</strong> </p>

<pre><code>&lt;a href="{% url 'users' %}"&gt;All Users&lt;/a&gt;
&lt;a href="{% url 'users' customers %}"&gt;Customers&lt;/a&gt;
&lt;a href="{% url 'users' promoters %}"&gt;Promoters&lt;/a&gt;
</code></pre>

<p>But its giving error when i access view without parameter</p>

<pre><code>Reverse for 'users' with arguments '('',)' and keyword arguments '{}' not found. 2 pattern(s) tried: ['administrator/users/$', 'administrator/users/(?P&lt;user_type&gt;\\w+)/$']

Exception Value: Reverse for 'users' with arguments '('',)' and keyword arguments '{}' not found. 2 pattern(s) tried: ['administrator/users/$', 'administrator/users/(?P&lt;user_type&gt;\\w+)/$']
</code></pre>

<p>Use this and check</p>

<pre><code>url(r'^users/(?P&lt;user_type&gt;\w+)/$', views.users, name='users_type'),
url(r'^users/$', views.users, name='users')
</code></pre>

<p>Link is:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="{% url 'users' %}"&gt;All Users&lt;/a&gt;
&lt;a href="{% url 'users_type' "customers" %}"&gt;Customers&lt;/a&gt;
&lt;a href="{% url 'users_type' "promoters" %}"&gt;Promoters&lt;/a&gt;</code></pre>
</div>
</div>
</p>

python django