Skip to main content

django-autoslug

Build status PyPI version Supported Python versions Supported Django versions License: LGPL-3.0

Django-autoslug is a reusable Django library that provides an improved slug field which can automatically:

  1. populate itself from another field,

  2. preserve uniqueness of the value and

  3. use custom slugify() functions for better i18n.

The field is highly configurable.

Requirements

Python 3.12, 3.13, or 3.14.

Django 5.2 LTS, 6.0, or 6.1.

Supported versions matrix

Every cell below is exercised in CI on each push:

Python 3.12

Python 3.13

Python 3.14

Django 5.2 LTS

Django 6.0

Django 6.1

Older Python and Django versions reached end-of-life and are no longer supported by this fork:

  • Django 4.2 LTS (extended support ended 2026-04-07)

  • Django 5.0 / 5.1 (mainstream support ended)

  • Python 3.9 / 3.10 / 3.11 (Django 5.2 minimum is 3.10, but Django 6.0 and 6.1 require 3.12+, so the intersection is 3.12+)

When Django 6.2 LTS ships, it will be added to the matrix.

It may be possible to successfully use django-autoslug-iplweb in other environments but they are not tested.

Installation

python -m pip install django-autoslug

Examples

A simple example:

from django.db.models import CharField, Model
from autoslug import AutoSlugField

class Article(Model):
    title = CharField(max_length=200)
    slug = AutoSlugField(populate_from='title')

More complex example:

from django.db.models import CharField, DateField, ForeignKey, Model
from django.contrib.auth.models import User
from autoslug import AutoSlugField

class Article(Model):
    title = CharField(max_length=200)
    pub_date = DateField(auto_now_add=True)
    author = ForeignKey(User)
    slug = AutoSlugField(populate_from=lambda instance: instance.title,
                         unique_with=['author__name', 'pub_date__month'],
                         slugify=lambda value: value.replace(' ','-'))

Documentation

See the complete documentation on ReadTheDocs. It is built automatically for the latest version.

Community

This application is maintained by Justin Mayer. It was initially created by Andy Mikhailenko and then improved by other developers. They are listed in AUTHORS.rst.

Please feel free to file issues and/or submit patches.

See CONTRIBUTING.rst for hints related to the preferred workflow.

Licensing

Django-autoslug is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Django-autoslug is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program; see the file COPYING.LESSER. If not, see GNU licenses.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_autoslug_iplweb-1.10.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_autoslug_iplweb-1.10.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file django_autoslug_iplweb-1.10.0.tar.gz.

File metadata

  • Download URL: django_autoslug_iplweb-1.10.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_autoslug_iplweb-1.10.0.tar.gz
Algorithm Hash digest
SHA256 63b1ef0d531576388155ebb6f657b39f614ca2fd9ea53e78c63c8bfa619e58c0
MD5 8d07a844c927f958d9940106ff2c81a0
BLAKE2b-256 aa7b3721ead6d9449bbd6bc7d980851a01a883a12852833f83cf840e90df9a70

See more details on using hashes here.

File details

Details for the file django_autoslug_iplweb-1.10.0-py3-none-any.whl.

File metadata

  • Download URL: django_autoslug_iplweb-1.10.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_autoslug_iplweb-1.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1aeb0704fb64d57cbd8becb3e113aa4574d93af2a96d1fcbf8fcd8b891f3f2db
MD5 c6b7b827b44657669cadf816db1fb9c4
BLAKE2b-256 d35502748837ed07248cfd8cc1e08e305744cac7bf0bba23cd55266bbba5390c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page