django-autoslug
An automated slug field for Django.
What it is and what it does
django-autoslug is a reusable Django library that adds an AutoSlugField to your models—a specialized CharField that automatically generates URL-safe slugs from other model fields. Instead of manually creating and maintaining slug values, you configure the field to populate itself from a source field (like a title), and it handles the conversion to lowercase, hyphenated text automatically. The field enforces uniqueness constraints, optionally scoped to other fields, so you can have unique slugs per author or per publication date if needed.
The main value is reducing boilerplate in Django projects: you avoid writing custom save() methods or signals to generate slugs, and you get built-in support for custom slugification functions to handle non-ASCII characters and internationalization. The field is highly configurable—you can supply a lambda to derive the slug from multiple fields, define which other fields must be considered when checking uniqueness, and plug in your own slugify function. It has no external runtime dependencies beyond Django itself.
Use it for:
- Auto-generate URL slugs for blog posts, articles, or product pages from their titles without manual slug management.
- Enforce unique slugs per author or category by scoping uniqueness constraints to related fields.
- Handle international content with custom slugify functions that transliterate non-ASCII characters appropriately.
- Reduce boilerplate in Django models by replacing manual slug-generation logic with a declarative field.
- Maintain slug consistency across model updates—the field regenerates automatically when the source field changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Django model field that automatically generates and maintains URL-friendly slugs from other fields, with built-in uniqueness enforcement and support for custom slugification logic.
Yes, with conditions. django-autoslug is stable, well-established (since 2009), and solves a common Django problem cleanly with zero external dependencies. However, the last release was April 2023 and maintenance is aging; verify compatibility with your current Django version before adopting. No known security vulnerabilities. The LGPL license is permissive for most use cases but requires derivative works to remain open-source.
Install
django-autoslug on PyPI
pip
pip install django-autosluguv
uv add django-autoslugpoetry
poetry add django-autoslugInstalling django-autoslug
Before you install
Low friction install with no runtime dependencies. Last release was over a year ago (April 2023) and the repository shows aging maintenance status, though it remains active and archived status is false.
License in practice
Licensed under GNU Lesser General Public License v3 (copyleft). You may use and modify the package freely, but derivative works must also be distributed under LGPL or a compatible license.
Quickstart
pip install django-autoslug
from django.db.models import CharField, Model
from autoslug import AutoSlugField
class Article(Model):
title = CharField(max_length=200)
slug = AutoSlugField(populate_from='title')
Requires Django 3.2 or higher and Python 3.7 or higher.
Verify before relying
- Whether the aging maintenance status (last release April 2023) affects compatibility with current Django versions beyond 3.2.
- Real-world performance characteristics when handling large numbers of unique slug collisions.
Package facts
| License | GNU Lesser General Public License (LGPL), Version 3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 1,229 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 408,571/month — #6,879 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_autoslug-1.9.9-py2.py3-none-any.whl
Keywords: django, field, slug, auto, unique, transliteration, i18n
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
slugifyConverts text strings into URL-safe slugs by…
unclear · top 15,000 on PyPI
unicode-slugifyConverts strings into URL-friendly slugs while…
permissive · top 15,000 on PyPI
python-slugifyConverts text strings—including unicode, HTML…
permissive · top 1,000 on PyPI
random-slugsGenerates random word-based slugs with…
unclear · top 15,000 on PyPI
shortuuidGenerates concise, URL-safe unique identifiers…
permissive · top 1,000 on PyPI
django-multiselectfieldAdds model and form fields to Django that let…
copyleft · top 5,000 on PyPI
django-organizationsAdds multi-user group and account management to…
permissive · top 15,000 on PyPI
coolnameGenerates random human-readable names and…
permissive · top 5,000 on PyPI
django-safedeleteProvides soft-delete functionality for Django…
permissive · top 5,000 on PyPI
django-reverse-adminAdds reverse inline support to Django admin for…
permissive · top 15,000 on PyPI