django-sqids
Non-intrusive sqids library for Django
Decision gist · record as of 2026-08-14
Yes, if you need to expose model IDs as obfuscated strings in URLs or APIs without database changes. The package is low-friction, well-tested across modern Django and Python versions, and has no known vulnerabilities. The aging status (401 days since last release) is not a blocker—the last commit is recent and the codebase is stable—but verify that the documented Django and Python versions match your project before committing.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 3.2 or later and Python 3.8.1 or later.
- Low friction—single runtime dependency (sqids) and a pure-Python wheel.
- Actively maintained with a recent commit (2025-07-09) and tested against Django 3.2, 4.2, 5.0 and Python 3.8–3.12, though the project is aging (401 days since last release).
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects without restriction.
last release 2025-07-09 (401 days) · last repo commit 2025-07-09 · 90 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 88,554 downloads/mo, #13,717 on PyPI
Alternatives
Verify before relying
pip install django-sqids
from django_sqids import SqidsField
from django.db import models
class Item(models.Model):
sqid = SqidsField(real_field_name="id")
item = Item.objects.create()
item.sqid # e.g., '1Z'
Item.objects.get(sqid="1Z")- Performance impact of sqid encoding/decoding on large querysets or high-throughput applications.
- Compatibility with Django ORM features beyond the documented lookups (in, isnull, gt, gte, lt, lte).
- Behavior when used with Django's prefetch_related or select_related optimizations.
What it is and what it does
django-sqids is a Django model field that transparently encodes your model's primary key as a sqid—a short, URL-safe, obfuscated string—without storing anything extra in the database or altering your model schema. It acts as a proxy over the real `id` field, so queries and filtering work seamlessly: you can filter by sqid string, use it in URLs as a slug, and even search by sqid in Django Admin. The underlying integer ID remains unchanged; the sqid is computed on the fly.
The package is built on the sqids library and supports customization per field (min_length, alphabet, prefix) or globally via Django settings. It integrates with Django REST Framework serializers and supports standard ORM lookups like `in`, `gt`, `gte`, `lt`, `lte`, and `isnull`. The project was forked from django-hashids to adopt the newer Sqids library, which removed the "salt" parameter; django-sqids provides a `shuffle_alphabet` helper to achieve similar per-field uniqueness.
Use it for
- Expose model IDs in URLs and APIs as short, non-sequential sqid strings instead of raw integers.
- Hide internal database IDs from external users while keeping queries simple and database-native.
- Search and filter records by sqid in Django Admin without writing custom code.
- Generate unique, obfuscated identifiers for each model or field using per-instance alphabet shuffling.
- Build REST APIs that accept sqid strings in place of numeric IDs without custom serializer logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to expose model IDs as obfuscated strings in URLs or APIs without database changes.
The package is low-friction, well-tested across modern Django and Python versions, and has no known vulnerabilities. The aging status (401 days since last release) is not a blocker—the last commit is recent and the codebase is stable—but verify that the documented Django and Python versions match your project before committing.
Install
django-sqids on PyPI
Before you install
Low friction—single runtime dependency (sqids) and a pure-Python wheel. Actively maintained with a recent commit (2025-07-09) and tested against Django 3.2, 4.2, 5.0 and Python 3.8–3.12, though the project is aging (401 days since last release).
Requires Django 3.2 or later and Python 3.8.1 or later.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects without restriction.
Quickstart
pip install django-sqids
from django_sqids import SqidsField
from django.db import models
class Item(models.Model):
sqid = SqidsField(real_field_name="id")
item = Item.objects.create()
item.sqid # e.g., '1Z'
Item.objects.get(sqid="1Z")
Verify before relying
- Performance impact of sqid encoding/decoding on large querysets or high-throughput applications.
- Compatibility with Django ORM features beyond the documented lookups (in, isnull, gt, gte, lt, lte).
- Behavior when used with Django's prefetch_related or select_related optimizations.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4,>=3.8.1 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagesqids |
| Maintenance | Aging 401 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 88,554 / month, #13,717 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: django_sqids-0.2.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django model field sqids”
- django-sqidsAdds a Django model field that encodes primary keys as short,…
- django-choices-fieldProvides Django model fields that store and retrieve Django's…
- django-model-utilsProvides reusable model mixins and field utilities for Django…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also django-hashids · sqids · django-hashid-field · hashids · shortuuid · django-bitfield · django-picklefield · django-netfields · djangoql · django-deprecate-fields