--- id: django-hashid-field version: "3.4.1" license: MIT license_treatment: permissive maintenance: dormant --- # django-hashid-field — A Hashids obfuscated Django Model Field License: permissive · Maintenance: dormant · Downloads: 190.5K/mo ## 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 above — verify before relying. Provides a Django model field that obfuscates integer IDs using the Hashids library, storing integers in the database while exposing them as encoded strings. 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 pip install django-hashid-field uv add django-hashid-field poetry add django-hashid-field ## Installing django-hashid-field 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. 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 Requires Django and hashids as runtime dependencies; requires a configured HASHID_FIELD_SALT in Django settings. 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 190.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django model field hashids, obfuscate integer ids django, hashid field django orm, hide database ids django, encode ids django models, retired, django-orm [View on SkillFed](https://skillfed.io/packages/django-hashid-field) · [View on PyPI](https://pypi.org/project/django-hashid-field/)