Hey everyone,
I published a small library called django-qp that brings FastAPI-style query parameter validation to Django using Pydantic.
The basic idea: you define a Pydantic model for your expected query params, and the library handles parsing, type conversion, and validation, returning a typed model instance with full IDE support instead of a dict.
It works with:
-
Django class-based views (mixin)
-
Django function-based views (decorator)
-
DRF APIView and ViewSet (with action-specific model selection)
-
Async views (transparent, no special config)
I built it because I got tired of the request.GET.get() → manual casting → manual validation dance, and the DRF serializer approach gives you a dict with no autocomplete. This gives you self.validated_params.field_name with proper typing.
Supports Django 4.2–6.x, Python 3.10–3.14, Pydantic v2. (Supports for django 3.2 pinging the version to 0.1.0
-
PyPI:
pip install django-qp
Would love to hear if anyone finds it useful or spots issues. Any feedback is welcome.