title: Reverse for 'blogpost' with arguments '('',)' not found
body: <p>Reverse for 'blogpost' with arguments '('',)' not found. 1 pattern(s) tried: ['blog/(?P[0-9]+)\Z']</p>
  <p>I face this problem in every project. So please any devloper solve this problem</p>
  <p><strong>my urls.py</strong></p>
  <pre><code>from django.urls import path
  from .import views
  
  urlpatterns = [
      path('', views.index, name='Blog_home'),
      path('&lt;int:pk&gt;', views.blogpost, name='blogpost'),
  ]
  </code></pre>
  <p><strong>my views.py</strong></p>
  <pre><code>from django.shortcuts import render
  from blog.models import Post
  
  # Create your views here.
  
  def index(request):
      post = Post.objects.all()
      context = {'post':post}
      return render(request, 'blog/bloghome.html', context)
  
  def blogpost(request, pk):
      blog_post = Post.objects.get(id=pk)
      context = {'blog_post':blog_post}
      return render(request, 'blog/blogpost.html', context)
  </code></pre>
  <p><strong>my models.py</strong></p>
  <pre><code>from django.db import models
  
  # Create your models here.
  
  class Post(models.Model):
      post_id = models.AutoField(primary_key=True)
      title = models.CharField(max_length=100)
      content = models.TextField()
      author = models.CharField(max_length=50)
      date_and_time = models.DateTimeField(blank=True)
  
      def __str__(self):
          return self.title
  </code></pre>
  <p><strong>Template: bloghome.html</strong></p>
  <pre><code>{% extends 'basic.html' %}
  
  {% block title %} Blog {% endblock title %}
  
  {% block blogactive %} active {% endblock blogactive %}
  
  {% block style %}
      .overlay-image{
          position: absolute;
          height: auto;
          width: 100%;
          background-position: center;
          background-size: cover;
          opacity: 0.5;
      }
  {% endblock style %}
  
  {% block body %}
  &lt;div class=&quot;container&quot;&gt;
    {% for post in post %}
      &lt;div class=&quot;row&quot;&gt;
        &lt;div class=&quot;col-md-7 py-4&quot;&gt;
          &lt;div class=&quot;row g-0 border rounded overflow-hidden flex-md-row shadow-sm h-md-250 position-relative&quot;&gt;
            &lt;!-- &lt;div class=&quot;col-auto m-auto img-fluid&quot;&gt;
              &lt;img src=&quot;#&quot;&gt;
            &lt;/div&gt; --&gt;
            &lt;div class=&quot;col p-4 blog d-flex flex-column position-static&quot;&gt;
              &lt;strong class=&quot;d-inline-block mb-2 text-primary&quot;&gt;Code&lt;/strong&gt;
              &lt;h3 class=&quot;mb-0&quot;&gt;{{post.title}}&lt;/h3&gt;
              &lt;div class=&quot;mb-1 text-muted&quot;&gt;{{post.date_and_time}}&lt;/div&gt;
              &lt;p class=&quot;card-text mb-auto&quot;&gt;{{post.content | truncatechars:150}}&lt;/p&gt;
              &lt;div class=&quot;my-2&quot;&gt;
                &lt;a href=&quot;{% url 'blogpost' blog_post.id %}&quot; class=&quot;btn btn-primary&quot;&gt;Continue reading&lt;/a&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      {% endfor %}
  &lt;/div&gt;
  {% endblock body %}
  </code></pre>
  <p><strong>Template: blogpost.html</strong></p>
  <pre><code>{% extends 'basic.html' %}
  
  {% block title %} Blog {% endblock title %}
  
  {% block body %}
  &lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;row&quot;&gt;
          &lt;div class=&quot;col-md-8&quot;&gt;
              &lt;h2&gt;{{post.title}}&lt;/h2&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  {% endblock body %}
  </code></pre>
  <p><strong>Error</strong></p>
  <pre><code>NoReverseMatch at /blog/
  
  Reverse for 'blogpost' with arguments '('',)' not found. 1 pattern(s) tried: ['blog/(?P&lt;pk&gt;[0-9]+)\\Z']
  </code></pre>
  <p>Error at Template: bloghome.html</p>
  <pre><code>&lt;a href=&quot;{% url 'blogpost' blog_post.id %}&quot; class=&quot;btn btn-primary&quot;&gt;Continue reading&lt;/a&gt;
  </code></pre>