title: Django Field 'id' expected a number but got 'coding'
body: <p>I am getting errors while trying to display all the posts related to one category.
  <strong>Error Message: Field 'id' expected a number but got 'coding'</strong></p>
  <p>View Code:</p>
  <pre><code>def CategoryView(request, cats):
      category_posts = Item.objects.filter(item_category=cats)
      return render(request, 'waqart/categories.html', {'cats':cats, 'category_posts':category_posts })
  </code></pre>
  <p>URL:</p>
  <p>path('category/str:cats/', CategoryView, name='category'),</p>
  <p>Template File:</p>
  <pre><code>{%extends 'waqart/base.html' %}
  {% block content %}
  &lt;h1&gt;{{cats}}&lt;/h1&gt; 
  &lt;div class=&quot;flex flex-wrap&quot;&gt;
  {% for item in category_posts %}
  
    &lt;h2 class=&quot;text-gray-900 text-xl title-font font-medium&quot;{{item.title|truncatechars:40}}&lt;/h2&gt;
  
  {% endfor %}
  
  &lt;/div&gt;
  
  {% endblock content %}
  </code></pre>
  <p>Model:</p>
  <pre><code>class Categories(models.Model):
      name = models.CharField(max_length=200)
      summary = models.CharField(max_length=200)
      slug = models.CharField(max_length=200)
  
      class Meta:
          verbose_name_plural = 'Categories'
  
      def __str__(self):
          
  
          return self.name
  
  
  
  class Item(models.Model):
      title = models.CharField(max_length=100)
      description= RichTextField(blank=True, null=True)
      main_image= models.ImageField(null=True, blank=True,upload_to='images/')
      date = models.DateTimeField(auto_now_add=True)
      item_slug = models.CharField(max_length=200, default=1)
      item_category = models.ForeignKey(Categories, default='Coding', on_delete=SET_DEFAULT)
  </code></pre>