More DjangoLesson 55Free preview
Add Slug Field
This lesson is part of Django · All levels
Summary
Slug is a text-friendly version of the URL, for example the title becomes 'learning-django'. You add it as a SlugField field to the model and then fill it out. Slug is useful for easy-to-read and SEO-friendly URLs.
Key points
- SlugField stores URL friendly text
- Often automated from the title
- Used as a clean URL section
- Usually set to unique
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.