Usage Guide

This section covers how to integrate django-display-ids into your Django project.

Overview

django-display-ids provides several integration points:

Models

Add the DisplayIDModel to give your models a display_id property. Use DisplayIDManager for convenient lookup methods.

Django Views

Add DisplayIDMixin to class-based views like DetailView, UpdateView, and DeleteView.

Django REST Framework

Use DisplayIDMixin (from contrib.rest_framework) for ViewSets and APIViews. Use DisplayIDField in serializers to include display IDs in responses.

Django Admin

Add DisplayIDAdminSearchMixin to enable searching by display ID or UUID.

Templates

Use the display_id filter to encode UUIDs as display IDs.