I use taggit with CBV I created one ListView deals with two querysets first if we don't have parameter in url retrieve all posts from database if we have slug from taggit then show only the posts that urls slug matched with slug in database using if statement but the problem is when I go to the post without any slug it's suppose to show me the all posts but didn't do that and send me this error. when I add manually the slug it works very well but the problem with all posts

