title: Reverse for 'create_order' with no arguments not found. 1 pattern(s) tried: ['create_order/(?P<pk>[^/]+)/$']
body: <p>I'm getting this error when I use</p>
  <pre><code>path('create_order/&lt;str:pk&gt;/', views.createOrder, name=&quot;create_order&quot;),
  </code></pre>
  <p>but there is no such error when path is..</p>
  <pre><code>path('create_order', views.createOrder, name=&quot;create_order&quot;),
  </code></pre>
  <p><strong>urls.py</strong></p>
  <pre><code>from django.urls import path
  from . import views
  
  
  urlpatterns = [
      path('', views.home, name=&quot;home&quot;),
      path('products/', views.products, name='products'),
      path('customer/&lt;str:pk_test&gt;/', views.customer, name=&quot;customer&quot;),
  
      path('create_order/&lt;str:pk&gt;/', views.createOrder, name=&quot;create_order&quot;),
      path('update_order/&lt;str:pk&gt;/', views.updateOrder, name=&quot;update_order&quot;),
      path('delete_order/&lt;str:pk&gt;/', views.deleteOrder, name=&quot;delete_order&quot;),
  
  
  ]
  </code></pre>
  <p><strong>views.py</strong></p>
  <pre><code>def createOrder(request, pk):
      OrderFormSet = inlineformset_factory(Customer, Order , fields=('product','status'), extra=9)
      customer = Customer.objects.get(id=pk)
      formset = OrderFormSet(queryset=Order.objects.none(), instance=customer)
      #form = OrderForm(initial={'customer':customer})
      if request.method == 'POST':
          #print('printing post', request.POST)
          formset = OrderFormSet(request.POST, instance=customer)
          if formset.is_valid():
              formset.save()
              return redirect('/')
  
      context = {'formset': formset}
      #return redirect('accounts/order_form.html', context)
      return render(request, 'accounts/order_form.html', context)
  </code></pre>
  <p>i also have tried redirect, that's not working the problem is with urls.py.</p>
  <p><strong>customer.html</strong></p>
  <pre><code>{% extends 'accounts/main.html' %}
  
  {% block content %}
  
  &lt;br&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col-md&quot;&gt;
          &lt;div class=&quot;card card-body&quot;&gt;
              &lt;h5&gt;Customer:&lt;/h5&gt;
              &lt;hr&gt;
              &lt;a class=&quot;btn btn-outline-info btn-sm btn-block&quot; href=&quot;&quot;&gt;Update Customer&lt;/a&gt;
              &lt;a class=&quot;btn btn-outline-info  btn-sm btn-block&quot; href=&quot;{% url 'create_order' customer.id %}&quot;&gt;Place Order&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
     &lt;div class=&quot;col-md&quot;&gt;
          &lt;div class=&quot;card card-body&quot;&gt;
              &lt;h5&gt;Contact Information&lt;/h5&gt;
              &lt;hr&gt;
              &lt;p&gt;Email: {{customer.email}}&lt;/p&gt;
              &lt;p&gt;Phone: {{customer.phone}}&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class=&quot;col-md&quot;&gt;
          &lt;div class=&quot;card card-body&quot;&gt;
              &lt;h5&gt;Total Order&lt;/h5&gt;
              &lt;hr&gt;
              &lt;h1 style=&quot;text-align: center;padding: 10px;&quot;&gt;{{order_count}}&lt;/h1&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;br&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col&quot;&gt;
          &lt;div class=&quot;card card-body&quot;&gt;
              &lt;form method=&quot;POST&quot;&gt;
                  &lt;button class=&quot;btn btn-primary&quot; type=&quot;submit&quot;&gt;Search&lt;/button&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;br&gt;
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col-md&quot;&gt;
          &lt;div class=&quot;card card-body&quot;&gt;
              &lt;table class=&quot;table table-sm&quot;&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Product&lt;/th&gt;
                      &lt;th&gt;Category&lt;/th&gt;
                      &lt;th&gt;Date Ordered&lt;/th&gt;
                      &lt;th&gt;Status&lt;/th&gt;
                      &lt;th&gt;Update&lt;/th&gt;
                      &lt;th&gt;Remove&lt;/th&gt;
                  &lt;/tr&gt;
  
                  {% for order in orders %}
                      &lt;tr&gt;
                          &lt;td&gt;{{order.product}}&lt;/td&gt;
                          &lt;td&gt;{{order.product.category}}&lt;/td&gt;
                          &lt;td&gt;{{order.date_created}}&lt;/td&gt;
                          &lt;td&gt;{{order.status}}&lt;/td&gt;
                          &lt;td&gt;&lt;a  class=&quot;btn btn-outline-info btn-md &quot; href=&quot;{% url 'update_order' order.id %}&quot;&gt;Update&lt;/a&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;a class=&quot;btn btn-outline-danger btn-md &quot; href=&quot;{% url 'delete_order' order.id %}&quot;&gt;Delete&lt;/a&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  {% endfor %}
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  <p><strong>models.py</strong></p>
  <pre><code>class Customer(models.Model):
      name = models.CharField(max_length=200, null=True, blank=True)
      phone = models.CharField(max_length=200, null=True, blank=True)
      email = models.CharField(max_length=200, null=True, blank=True)
      date_created = models.DateTimeField(auto_now_add=True, null=True)
  
      def __str__(self):
          return self.name
  </code></pre>
  <p><strong>order_form.html</strong></p>
  <pre><code>{% extends 'accounts/main.html' %}
  {% load static %}
  {% block content %}
  &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col-md-6&quot;&gt;
          &lt;div class=&quot;card card-body&quot;&gt;
              &lt;form action=&quot;&quot; method=&quot;POST&quot;&gt;
                  {% csrf_token %}
                  {{formset.managment_form}} &lt;!-- to remove the managmentForm data missing or has been tempered wiith , error --&gt;
                  {% for form in formset %}
                  {{formset}}    &lt;!--in context of views.py --&gt;
                  &lt;hr&gt;
                  {% endfor %}
  
                  &lt;input class=&quot;btn btn-outline-success btn-md&quot; type=&quot;submit&quot; name=&quot;submit&quot;&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  <p>I have added the templates , and thanks to all but I think the only problem is with urls.py , because if I use</p>
  <pre><code>path('create_order/&lt;str:pk&gt;/', views.createOrder, name=&quot;create_order&quot;),
  </code></pre>
  <p>instead of</p>
  <pre><code>path('create_order', views.createOrder, name=&quot;create_order&quot;),
  </code></pre>
  <p>then I get error, otherwise there is no such error for the above path.</p>