This Snippet is used for creating Unique slugs for Django Web Applications.
In building a web application, it is usually common to store contents in the database and a slug is generated based on the title of the content.
Problem
Two posts having the same title would always generate an error like this below.
This requires you to change the title of your post.
Solution
The unique slug snippet generates a unique slug even if two titles are the same. This eliminates the hassle of changing the title of your post.
This works by first checking the database if the slug exists. if it exists, it generates some random character and adds it to the end of the slug.
This ensures that no two titles have the same slug. This helps the users have a better experience with your web application.
Github: https://github.com/Rhotimee/Unique-Slug-Generator
Posted on Utopian.io - Rewarding Open Source Contributors