{"id":6589,"library":"django-autoslug","title":"Django Autoslug","description":"Django-autoslug is a reusable Django library that provides an improved slug field which can automatically: populate itself from another field, preserve uniqueness of the value, and use custom slugify() functions for better internationalization (i18n). The current version is 1.9.9. It maintains an active release cadence with regular updates and compatibility improvements for newer Django and Python versions.","status":"active","version":"1.9.9","language":"en","source_language":"en","source_url":"https://github.com/justinmayer/django-autoslug/","tags":["django","slug","automation","fields","model"],"install":[{"cmd":"pip install django-autoslug","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core framework dependency; requires Django 3.2 or higher for version 1.9.9.","package":"Django"},{"reason":"Recommended for proper transliteration of Unicode characters into ASCII slugs, though not a strict dependency. Install separately if needed.","package":"Unidecode","optional":true}],"imports":[{"symbol":"AutoSlugField","correct":"from autoslug import AutoSlugField"}],"quickstart":{"code":"from django.db import models\nfrom autoslug import AutoSlugField\n\nclass Article(models.Model):\n    title = models.CharField(max_length=200)\n    # The slug will be populated from the 'title' field\n    slug = AutoSlugField(populate_from='title', unique=True)\n\n    def __str__(self):\n        return self.title\n","lang":"python","description":"Define an `AutoSlugField` in your Django model, specifying the `populate_from` attribute to indicate which field should be used to generate the slug. Ensure `unique=True` if you require unique slugs."},"warnings":[{"fix":"Upgrade your Python and Django versions to meet the minimum requirements, or pin `django-autoslug` to an older compatible version if necessary.","message":"Version 1.9.9 removed support for end-of-life Python & Django versions. Ensure your environment meets the new requirements (Python 3.7+ or PyPy, Django 3.2+).","severity":"breaking","affected_versions":"1.9.9 and later"},{"fix":"Ensure your Django version is 3.1 or higher, or use a `django-autoslug` version prior to 1.9.8.","message":"In version 1.9.8, the import path for `FieldDoesNotExist` was moved for compatibility with Django 3.1+. This change may cause import errors in projects using older Django versions with `django-autoslug` 1.9.8 or later.","severity":"breaking","affected_versions":"1.9.8 and later (with Django < 3.1)"},{"fix":"Review the release notes for 1.9.0 to adapt your project. Manually enable `modeltranslation` support if required, and ensure your Python/Django versions are within the supported range.","message":"Version 1.9.0 introduced significant backwards incompatible changes, including limiting supported Python/Django versions (initially Python 2.7, 3.5, PyPy; Django 1.7.10+). Additionally, `modeltranslation` support was turned off by default.","severity":"breaking","affected_versions":"1.9.0 and later"},{"fix":"Install `Unidecode` (`pip install Unidecode`) in your project if you need to handle Unicode characters for slug generation.","message":"While `django-autoslug` supports Unicode, it relies on `Unidecode` for robust transliteration. `Unidecode` is not installed as a direct dependency, so if you're dealing with non-ASCII characters, you may encounter issues unless you install `Unidecode` manually (`pip install Unidecode`).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Reorder your model fields to place the `AutoSlugField` after the fields it depends on.","message":"Always declare the `AutoSlugField` *after* any model fields it references (via `populate_from` or `unique_with`). This ensures that the referenced fields are already processed when the slug is generated.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider setting `always_update=False` if slug stability is critical for public URLs. Implement 301 redirects if slugs must change for existing content, or use a strategy where slugs are only set on creation and not updated.","message":"Automatically updating slugs (especially if `always_update=True` is used) can lead to broken external links or SEO issues if the source fields are frequently changed. Slugs used in public URLs should generally remain stable.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to version 1.9.9 or later to prevent slugs from ending in dashes or underscores.","message":"Versions prior to 1.9.9 could generate slugs that end in a dash or underscore in certain situations.","severity":"gotcha","affected_versions":"<1.9.9"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}