title: Reverse for 'all_clients' with keyword arguments '{'client_id': 3}' not found. 1 pattern(s) tried: ['clients/all_clients/$']
body: <p>I am new to Django and I am having trouble implementing the edit template to my project. I am encountering the following error:</p>
  <blockquote>
  <p>Reverse for 'all_clients' with keyword arguments '{'client_id': 3}' not found. 1 pattern(s) tried: ['clients/all_clients/$']</p>
  </blockquote>
  <p>I have looked on the site for similar occurrences such as <a href="https://stackoverflow.com/questions/50574940/reverse-for-plan-edit-with-keyword-arguments-pk-not-found-1-pattern">Reverse for 'plan_edit' with keyword arguments</a></p>
  <p>but I haven't been able to pin point the issue. I believe the issue arises when I add a hyperlink to my <strong>all_clients.html</strong> template. Also, the template pages for <strong>/clients/edit_client/?/</strong> will load, however after submission using the save changes button the NoReserse Match error resurfaces as it attempts to load the <strong>clients/all_clients</strong> page.</p>
  <p>See code below:</p>
  <p><strong>models.py</strong></p>
  <pre><code>from django.db import models
  
  # Create your models here. 
  class Client(models.Model):
      #A client is composed of the company general info
      text = models.CharField('Company Name',default = 'Company Name', max_length = 200)
      phone_num = models.CharField('Phone Number', default = '000-000-000', max_length = 12)
      ceo_name = models.CharField ('CEO', max_length = 50)
      num_employees = models.IntegerField('Number of Employees', default = 0)
      maintenance_schedule = models.CharField('maintenance schedule', max_length = 100)
      date_added = models.DateTimeField(auto_now_add=True)
  
      def __str__(self):
          &quot;&quot;&quot;Return a string representation of the model.&quot;&quot;&quot;
          return self.text
  </code></pre>
  <p><strong>urls.py</strong></p>
  <pre><code>&quot;&quot;&quot;Defines URL patterns for clients.&quot;&quot;&quot;
  
  from django.urls import path from django.conf.urls import url
  
  from .import views
  
  app_name = 'clients' urlpatterns = [
      #Company Page
      path('index/', views.index, name = 'index'),
      
      #Page for listing all clients
      path('all_clients/', views.all_clients, name = 'all_clients'),
  
      #Page for adding a new client
      path('all_clients/&lt;int:client_id&gt;/', views.add_client, name = 'add_client'),
  
      #Page for adding a new client office using a form
      path('new_office/', views.new_office, name = 'new_office'),
  
      #Page for a company to edit their entry.
      path('edit_clients/&lt;int:client_id&gt;/', views.edit_client, name = 'edit_client'),
      ]
  </code></pre>
  <p><strong>view.py</strong></p>
  <pre><code>from django.shortcuts import render, redirect
  from .models import Client, Location, Lease, Soft_Service, Hard_Service, Safety_Service
  from .forms import ClientForm
  
  # Create your views here.
  def add_client(request, client_id):
      &quot;&quot;&quot;Comapany page for updating facilities info&quot;&quot;&quot;
      client = Client.objects.get(id = client_id)
      context = {'client':client}
      return render(request, 'clients/add_client.html', context)
  
  def all_clients(request):
      '''Shows list of all clients'''
      all_clients = Client.objects.order_by ('date_added')
      context = {'all_clients':all_clients}
      return render(request, 'clients/all_clients.html', context)
  
  def index(request):
      &quot;&quot;&quot;Test Page&quot;&quot;&quot;
      return render(request, 'clients/index.html')
  
  def edit_client(request, client_id):
      &quot;&quot;&quot;Edit an existing Entry.&quot;&quot;&quot;
      client = Client.objects.get(id=client_id)
  
      if request.method != 'POST':
          #Inital request; pre-fill form with the current company info.
          form = ClientForm(instance=client)
      else:
          # Post data submitted; process data.
          form = ClientForm(instance=client, data=request.POST)
          if form.is_valid():
              form.save()
              return redirect('clients:all_clients' , client_id=client.id)
  
      context = {'form': form, 'client': client}
      return render(request, 'clients/edit_client.html', context)
  </code></pre>
  <p><strong>edit_client.html</strong></p>
  <pre><code>{% extends &quot;app/layout.html&quot; %}
  
  {% block content %} {% load staticfiles %} &lt;p&gt;&lt;a href=&quot;{% url 'clients:add_client' client.id %}&quot;&gt;Company: {{ client }}&lt;/a&gt;&lt;/p&gt;
  
  &lt;h4&gt;See Our Clients&lt;/h4&gt;
  
  &lt;&lt;form action=&quot;{% url 'clients:edit_client&lt;client_id&gt;' client.id %}&quot; method=&quot;post&quot;&gt;
      {% csrf_token %}
      {{ form.as_p }}
      &lt;button name=&quot;submit&quot;&gt;Save changes&lt;/button&gt; &lt;/form&gt;
      
  
  {% endblock %}
  </code></pre>
  <p><strong>all_clients.html</strong></p>
  <pre><code>{% extends &quot;app/layout.html&quot; %}
  
  {% block content %}
  {% load staticfiles %}
  &lt;div class=&quot;d-flex&quot; style=&quot;height:75px&quot;&gt;&lt;/div&gt;
      &lt;div class=&quot;btn bg-white text-lg-left&quot; style=&quot;width:425px&quot;&gt;
          &lt;h4&gt;See Our Clients&lt;/h4&gt;
  
          &lt;ul&gt;
              {% for add_client in all_clients %}
                  &lt;li&gt;
                      &lt;a href=&quot; {%  url 'clients:add_client' add_client.id %}&quot;&gt;{{ add_client }}&lt;/a&gt;
                  &lt;/li&gt;
              {%empty %}
                  &lt;li&gt; No clients have been added yet. &lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
  
          &lt;a class=&quot;btn btn-secondary&quot; href=&quot; {% url 'clients:new_office' %}&quot;&gt;Add a new location&lt;/a&gt;
  &lt;a class=&quot;btn btn-secondary&quot; href=&quot; {% url 'clients:edit_client' client.id %}&quot;&gt;Add a new location&lt;/a&gt;
  
      &lt;/div&gt;
  {% endblock content %}
  </code></pre>