Turn titles into URL-safe slugs: "Crème Brûlée & Café!" → "creme-brulee-cafe".
Implement slugify(text, max_len=None):
unicodedata.normalize("NFKD", text) and drop non-ASCII characters (this strips accents).a-z0-9 with a single -. Strip leading and trailing -.max_len is set and the slug is longer, cut it to max_len characters. If that cut a word in half (the next character isn't -) and the cut slug contains a -, drop the partial word. Strip trailing -.Then implement unique_slug(text, existing): the slug, or slug-2, slug-3, … (the first one not in the set existing).