django-hashid-field
A Hashids obfuscated Django Model Field
Decision gist · record as of 2026-08-14
No—not for new projects. The package is officially retired and the maintainer explicitly recommends against it. Existing projects using it do not require immediate changes, but should plan migration to an actively maintained alternative. The low install friction and permissive license do not offset the dormant maintenance status and explicit retirement notice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django and hashids as runtime dependencies; requires a configured HASHID_FIELD_SALT in Django settings.
- Low install friction with only two runtime dependencies (Django and hashids).
- However, the package is dormant—last release was 2024-05-03 and no commits since then.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, making it legally straightforward to adopt in most projects.
last release 2024-05-03 (833 days) · last repo commit 2024-05-03 · 372 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 190,549 downloads/mo, #9,906 on PyPI
Alternatives
Verify before relying
pip install django-hashid-field
# In settings.py:
HASHID_FIELD_SALT = "a long and secure salt value that is not the same as SECRET_KEY"
# In models.py:
from hashid_field import HashidField
from django.db import models
class Book(models.Model):
reference_id = HashidField()
# Usage:
b = Book.objects.create()
print(b.reference_id) # Hashid(1): OwLxW8D- Whether the retirement affects compatibility with Django 5.0 or newer Python versions in practice
- Migration path recommendations for projects currently using this package
What it is and what it does
Django-hashid-field is a custom Django model field that replaces integer primary keys or regular integer fields with hashid-encoded equivalents. It stores the actual integer in the database but exposes it as an obfuscated string (e.g., 'OwLxW8D' instead of 123), making IDs less predictable in URLs and APIs. The field supports filtering, lookups, and sorting by either the hashid string or the underlying integer, and can be dropped into existing models as a replacement for AutoField or IntegerField.
The package is built on top of the hashids library and integrates with Django's ORM, REST Framework, and admin interface. It supports per-field configuration of salt, alphabet, and prefix, as well as global settings. However, the package is now retired and explicitly marked as no longer recommended for new projects—the maintainer recommends migrating to alternatives.
Use it for
- Replace sequential integer IDs in URLs with obfuscated strings to avoid exposing database size or ID patterns
- Add hashid-based primary keys to new Django models while maintaining integer storage for performance
- Migrate existing AutoField models to hashid equivalents while optionally allowing integer lookups during transition
- Prefix hashids with custom strings (e.g., 'user_h6ks82g') for human-readable, type-hinted API identifiers
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No—not for new projects.
The package is officially retired and the maintainer explicitly recommends against it. Existing projects using it do not require immediate changes, but should plan migration to an actively maintained alternative. The low install friction and permissive license do not offset the dormant maintenance status and explicit retirement notice.
Install
django-hashid-field on PyPI
Before you install
Low install friction with only two runtime dependencies (Django and hashids). However, the package is dormant—last release was 2024-05-03 and no commits since then. The project is explicitly retired and no longer recommended for new projects; existing users should consider migrating.
Requires Django and hashids as runtime dependencies; requires a configured HASHID_FIELD_SALT in Django settings.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it legally straightforward to adopt in most projects.
Quickstart
pip install django-hashid-field
# In settings.py:
HASHID_FIELD_SALT = "a long and secure salt value that is not the same as SECRET_KEY"
# In models.py:
from hashid_field import HashidField
from django.db import models
class Book(models.Model):
reference_id = HashidField()
# Usage:
b = Book.objects.create()
print(b.reference_id) # Hashid(1): OwLxW8D
Verify before relying
- Whether the retirement affects compatibility with Django 5.0 or newer Python versions in practice
- Migration path recommendations for projects currently using this package
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesDjangohashids |
| Maintenance | Dormant 833 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 190,549 / month, #9,906 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.2Framework :: Django :: 5.0Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: django_hashid_field-3.4.1-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 › “obfuscate integer ids django”
- django-hashid-fieldProvides a Django model field that obfuscates integer IDs using the…
- django-sqidsAdds a Django model field that encodes primary keys as short,…
- hashidsGenerates short, unique, non-sequential hashes from integers,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also django-hashids · django-sqids · hashids · django-deprecate-fields · django-fernet-encrypted-fields · django-cryptography-5 · django-cryptography · django-cryptography-django5 · drf-writable-nested · django-picklefield