title: Reverse for 'edit' with no arguments not found. 1 pattern(s) tried: ['articles/edit/(?P<pk>[0-9]+)/$']
body: <p>I am a beginner in Django and now i am developing a blogging application. At the article editing section i got stucked and I dont know why its showing this error. Searched a lot and cant find an answer </p>
  
  <pre><code>NoReverseMatch at /articles/edit/2/
  
  Reverse for 'edit' with no arguments not found. 1 pattern(s) tried: ['articles/edit/(?P&lt;pk&gt;[0-9]+)/$']
  </code></pre>
  
  <p>edit_articles section in </p>
  
  <h2>views.py</h2>
  
  <pre><code>@login_required(login_url="/accounts/login/")
  def edit_articles(request, pk):
      article = get_object_or_404(Article, id=pk)
      if request.method == 'POST':
          form = forms.CreateArticle(request.POST, instance=article)
          if form.is_valid():
              post = form.save(commit=False)
              post.author = request.user
              post.save()
              return redirect('articles:myarticles')
      else:
          form = forms.CreateArticle(instance=article)
      return render(request, 'articles/article_edit.html', {'form': form})
  </code></pre>
  
  <h1>article_edit.html</h1>
  
  <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>{% extends 'base_layout.html' %}
  
  {% block content %}
  &lt;div class="create-article"&gt;
    &lt;form class="site-form" action="{% url 'articles:edit' %}" method="post" enctype="multipart/form-data"&gt;
      {% csrf_token %}
      &lt;div class="jumbotron"&gt;
        &lt;div class="heading col-md-12 text-center"&gt;
          &lt;h1 class="b-heading"&gt;Edit Article&lt;/h1&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-md-6"&gt;
            &lt;div class="form-group"&gt;
              {{ form.title }}
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col-md-6"&gt;
            &lt;div class="form-group"&gt;
              {{ form.slug }}
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col-md-6"&gt;
            &lt;div class="form-group"&gt;
              {{ form.thumb }}
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col-md-12"&gt;
            &lt;div class="form-group"&gt;
              {{ form.body }}
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;button type="submit" class="btn btn-primary btn-lg btn-block"&gt;Update&lt;/button&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  
  {% endblock %}</code></pre>
  </div>
  </div>
  </p>
  
  <h2>urls.py</h2>
  
  <pre><code>from django.urls import path
  from . import views
  
  app_name = 'articles'
  
  urlpatterns = [
      path('', views.article_list, name='list'),
      path('create/', views.article_create, name='create'),
      path('edit/&lt;int:pk&gt;/', views.edit_articles, name='edit'),
      path('myarticles/',views.my_articles, name='myarticles'),
      path('&lt;slug&gt;/', views.article_detail, name='details'),
  ]
  </code></pre>
  
  <h2>my_articles.html</h2>
  
  <p>That button in 4th  is triggering the edit function with primary key and redirects to edit page</p>
  
  <pre><code>&lt;tbody&gt;
  {% if articles %}
  {% for article in articles %}
  &lt;tr class="table-active"&gt;
    &lt;th scope="row"&gt;1&lt;/th&gt;
    &lt;td&gt;{{ article.title }}&lt;/td&gt;
    &lt;td&gt;{{ article.date }}&lt;/td&gt;
    &lt;td&gt;&lt;a href="{% url 'articles:edit' pk=article.pk %}"&gt;&lt;button type="button" class="btn btn-info"&gt;Edit&lt;/button&gt;&lt;/a&gt;&lt;/td&gt;
  {% endfor %}
  &lt;/tr&gt;
  {% else %}
  &lt;tr&gt;
    &lt;td colspan=4 class="text-center text-danger"&gt;Oops!! You dont have any articles.&lt;/td&gt;
  &lt;/tr&gt;
  {% endif %}
  </code></pre>
  
  <p></p>