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.

Release files for django-autoslug-iplweb 1.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-autoslug-iplweb 1.10.0
File Size Uploaded
django_autoslug_iplweb-1.10.0.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-autoslug-iplweb 1.10.0
File Interpreter ABI Platform
django_autoslug_iplweb-1.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.9 kB

Release files / django_autoslug_iplweb-1.10.0.tar.gz

Download URL django_autoslug_iplweb-1.10.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
63b1ef0d531576388155ebb6f657b39f614ca2fd9ea53e78c63c8bfa619e58c0
BLAKE2b-256 checksum
How to use checksums
aa7b3721ead6d9449bbd6bc7d980851a01a883a12852833f83cf840e90df9a70
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / django_autoslug_iplweb-1.10.0-py3-none-any.whl

Download URL django_autoslug_iplweb-1.10.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1aeb0704fb64d57cbd8becb3e113aa4574d93af2a96d1fcbf8fcd8b891f3f2db
BLAKE2b-256 checksum
How to use checksums
d35502748837ed07248cfd8cc1e08e305744cac7bf0bba23cd55266bbba5390c
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

1.10.0 This release

2 release files

1.9.5

1 release file

1.9.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page