title: How to manage slug in views.py django
body: <p>I'm having trouble dealing with slugs: I have defined different slugs for every article in admin panel but on my website, if I type any random slug(e.g- fvrryybr,34,d4g5tg5) on any page of my app it takes me to the webpage of <strong>article function</strong> of views.py<br>
  I don't know how to deal with as I a beginner in Django</p>
  
  <p>____view.py___ </p>
  
  <pre><code> def article(request,slug):
      allarticles = Article.objects.all()
      context = {'allarticles':allarticles}
      return render(request,"news/Home/tnews/blog-single.html",context)
  </code></pre>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Post(models.Model):
      no = models.CharField(max_length=1000,primary_key=True)
      title = models.CharField(max_length=100)
      content = models.TextField()
      cover = models.ImageField(upload_to='images/')
      timeStamp = models.DateTimeField(blank=True)
      slug = models.SlugField(null=False,unique=True)
  
      def __str__(self):
          return self.title
  
  class Article(models.Model):
     heading = models.CharField(max_length=1000)
     player = models.CharField(max_length=100)
     article = models.TextField()
     source = models.CharField(max_length=50)
     date = models.DateTimeField(blank=True)
     image = models.ImageField(upload_to='images/')
  
     def __str__(self):
      return 'Article on '+ self.player
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>   path("&lt;slug:slug&gt;",views.article,name='article')
  </code></pre>