title: NoReverseMatch at / Reverse for 'delete_order' with arguments '('',)' not found. 1 pattern(s) tried: ['delete_order/(?P<pk>[^/]+)/$']
body: <p>I am using <code>&lt;str:pk&gt;</code> to delete a specific data in table. But this is not working. I followed a tutorial with no avail, here is what I get:</p>
  <blockquote>
  <p>NoReverseMatch at /</p>
  <p>Reverse for 'delete_order' with arguments '('',)' not found. 1 pattern(s) tried: ['delete_order/(?P[^/]+)/$']</p>
  </blockquote>
  <p>views.py</p>
  <pre><code>def deleteOrder(request, pk):
      order = anime.objects.get(id=pk)
      if request.method == &quot;POST&quot;:
          order.delete()
          return redirect('/')
  
      context={'list':order}
      return render(request, 'main/delete.html',context)
  </code></pre>
  <p>table.html</p>
  <pre><code>    &lt;td&gt;&lt;a href=&quot;&quot; class=&quot;btn btn-success&quot;&gt;Update&lt;/a&gt;&lt;/td&gt;
      &lt;td&gt;&lt;a href=&quot;{% url 'delete_order' order.id %}&quot; class=&quot;btn btn-danger&quot;&gt;Delete&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  {% endfor %}
  </code></pre>
  <p>urls.py</p>
  <pre><code>urlpatterns = [
      path('',views.homepage,name =&quot;homepage&quot;),
      path('anime/',views.addAnime,name=&quot;anime&quot;),
      path('delete_order/&lt;str:pk&gt;/', views.deleteOrder, name=&quot;delete_order&quot;),
  ]
  </code></pre>
  <p>I can't seem to find anything wrong with my code.</p>