Uncategorized

How can i remove extra “s” from django admin panel?

Pinterest LinkedIn Tumblr

How can i remove extra “s” from django admin panel?

Add new class inside model class called Meta  in your model to specify plural display name. Example, if you have model name is Blog, in the admin panel displays Blogs  Blogs, now just add Meta class, we can change it to Blogs.

I have changed your code to fix the issue:


class Blog(models.Model):
    title = models.CharField(max_length=200, default='')
    slug = models.SlugField(max_length=200, default='')
    created_on = models.DateTimeField(auto_now_add=True)
    updated_on = models.DateTimeField(auto_now= True)
    
    class Meta:
        verbose_name_plural = "blog"