NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1607 most downloaded on PyPI
PEP-484 stubs for django-rest-framework
Last release 1 months ago
25 Aug 2026
Ships fairly regularly
a new release about every 5 weeks
Most releases are documented
notes for 32 of 43 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
44 releases · first in 2019
This release dropped Python 3.10 support, following django-stubs upstream (requires Python 3.11+ now).
This release dropped Python 3.10 support, following django-stubs upstream (requires Python 3.11+ now).
@type_check_only by @intgr with @Copilot in #1038PrimaryKeyRelatedField pk_field attribute & parameter type by @intgr with @Copilot in #1047ManyRelatedField type parameters & relation field default/initial types by @intgr in #1049allowlist_todo.txt and remove the file by @intgr with @Copilot in #1039Full Changelog: 3.18.0...3.18.1
One column per quarter.
This is the first version to be based on DRF 3.18
django-stubs 6.0.x - next release will require 6.1.xFull Changelog: 3.17.1...3.18.0
Clean up and improve rest_framework.fields by @emmanuel-ferdman in #988
rest_framework.fields by @emmanuel-ferdman in #988Sequence in paginate_queryset, not just QuerySet by @bvedad in #1001request.data type to include list[Any] for JSON bulk payloads by @alanjds in #1016Full Changelog: 3.17.0...3.17.1
This is the first version targeting djangorestframework v3.17 and django-stubs v6.0. However, not all stubs have been updated yet for 3.17:
This is the first version targeting djangorestframework v3.17 and django-stubs v6.0. However, not all stubs have been updated yet for 3.17:
UniqueTogetherValidator code support and fix defaults in validators by @emmanuel-ferdman in #947Serializer context type dict -> Mapping by @BrianHicks in #946rest_framework.renderers by @emmanuel-ferdman in #960rest_framework.fields by @emmanuel-ferdman in #964types-* dev dependencies for automatic Renovate updates by @Copilot in #983Full Changelog: 3.16.9...3.17.0
This will be the last version to support django-stubs 5.2. But django-stubs 6.0 will mostly also work if you use older Django.
django-stubs 5.2.django-stubs 6.0 will mostly also work if you use older Django.djangorestframework 3.16 -- the next version will be updating to 3.17.👉 Your help is needed to update stubs for djangorestframework version 3.17!
APIClient.generic by @noamkush in #911RelatedField.get_queryset type by @amaral-daniel in #912documentation and schemas by @emmanuel-ferdman in #909pagination by @brianhelba in #917QuerySet row-type through APIs handling QuerySet by @brianhelba in #916rest_framework.schemas by @emmanuel-ferdman in #919rest_framework.utils by @emmanuel-ferdman in #935@override decorators & align mypy config with django-stubs by @intgr in #928noqa: F811 directive by @intgr in #926Full Changelog: 3.16.8...3.16.9
Make types-requests an optional dependency -- add requests extra by @bluetech in #900
Make types-requests an optional dependency -- add requests extra by @bluetech in #900
The types-request dependency is now optional. If you use rest_framework.test.RequestsClient, consider installing the requests extra: djangorestframework-stubs[requests].
Fix Request stub allowing arbitrary attribute access by @emmanuel-ferdman in #904
Type checkers would previously ignore when accessing non-existant Request attributes.
Full Changelog: 3.16.7...3.16.8
Remove requests dependency by @bluetech in #896
requests dependency by @bluetech in #896ModelSerializer and ModelSerializer.Meta fields use ClassVar by @brianhelba in #898Full Changelog: 3.16.6...3.16.7
Update dependency mypy to >=1.13,<1.20 by @renovate [bot] in #877
assert_type() tests by @intgr in #854uv.lock by @intgr in #856Full Changelog: 3.16.5...3.16.6
Fix Field.get_attribute() return and RelatedField.to_representation() parameter for PKOnlyObject by @emmanuel-ferdman in #852
Field.get_attribute() return and RelatedField.to_representation() parameter for PKOnlyObject by @emmanuel-ferdman in #852Full Changelog: 3.16.4...3.16.5
Update schemas.get_schema_view(generator_class=) parameter to accept None by @kwang1215 in #703
schemas.get_schema_view(generator_class=) parameter to accept None by @kwang1215 in #703SlugRelatedField.slug_field type: cannot be None by @lev-blit in #830schema.generators.common_path() by @kwang1215 in #700templatetags.rest_framework.urlize_quoted_links() by @Limsunoh in #699uv to manage dev dependencies by @intgr & @CodingWithSaksham in #797uv.lock unpinned dependencies by @intgr in #835uv by @intgr in #838Full Changelog: 3.16.3...3.16.4
Using alpha version in case anything goes wrong -- so users won't be updated automatically.
Testing new release workflow.
Using alpha version in case anything goes wrong -- so users won't be updated automatically.
[Breaking change] Remove work-around for ModelSerializer.instance field for many=True by @JoshFerge in https://github.com/typeddjango/djangorestframew…
[Breaking change] Remove work-around for ModelSerializer.instance field for many=True by @JoshFerge in https://github.com/typeddjango/djangorestframework-stubs/pull/719
Accept lazy strings as path in APIRequestFactory and APIClient http methods by @browniebroke in https://github.com/typeddjango/djangorestframework-stubs/pull/825
.pre-commit-config and CONTRIBUTING.MD to latest Python version by @CodingWithSaksham in https://github.com/typeddjango/djangorestframework-stubs/pull/819Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.16.2...3.16.3
Remove deprecated schema methods from BaseFilterProtocol by @huynguyengl99 in https://github.com/typeddjango/djangorestframework-stubs/pull/809
djangorestframework to 3.16.1 by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/800Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.16.1...3.16.2
Fix CI by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/770
APIView.options() return type to Response by @rohitrhmn1 in https://github.com/typeddjango/djangorestframework-stubs/pull/788Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.16.0...3.16.1
Bump django-rest-framework to 3.16.0 by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/760
django-rest-framework to 3.16.0 by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/760Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.15.4...3.16.0
Compat with django-stubs@5.2 was added
django-stubs@5.2 was addedrest_framework.authtoken.models.Token.save to allowlist by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/743wsgi_request to the _MonkeyPatchedResponse by @PedroPerpetua in https://github.com/typeddjango/djangorestframework-stubs/pull/747request.user by @davidmannion in https://github.com/typeddjango/djangorestframework-stubs/pull/758Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.15.3...3.15.4
Update django-stubs requirements
django-stubs requirementsmypy requirementsFull Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.15.2...3.15.3
Add GitHub actions release workflow by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/660
GenericAPIView.serializer_class classvar type generics by @jheld in https://github.com/typeddjango/djangorestframework-stubs/pull/672Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.15.1...3.15.2
Fix class hierachy and TypeVars of Serializer classes by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/520
rest_framework.compat.inflection by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/607ModelSerializer.build_*_field() argument types by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/609ignore_missing_imports) by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/611DefaultRouter constructor and attributes by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/610RenameRouterMethods metaclass by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/612StrPromise as Validator.message and missing_message by @q0w in https://github.com/typeddjango/djangorestframework-stubs/pull/618BaseSerializer.is_valid.raise_exception() parameter kw-only by @Viicos in https://github.com/typeddjango/djangorestframework-stubs/pull/620SlugRelatedField.to_representation() parameter name by @DongwookKim0823 in https://github.com/typeddjango/djangorestframework-stubs/pull/632rest_framework.utils by @DongwookKim0823 in https://github.com/typeddjango/djangorestframework-stubs/pull/633APIRequestFactory method signatures by @DongwookKim0823 in https://github.com/typeddjango/djangorestframework-stubs/pull/634objects attribute to Token by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/644request.user by @flaeppe in https://github.com/typeddjango/djangorestframework-stubs/pull/651accepted_renderer, accepted_media_type to Request and Response by @q0w in https://github.com/typeddjango/djangorestframework-stubs/pull/649Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.15.0...3.15.1
Add ValidationError params= argument & default_params attribute by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/338
ValidationError params= argument & default_params attribute by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/338SimpleRouter use_regex_path argument by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/344construct_search function queryset argument for SearchFilter by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/574get_field_name function of AutoSchema by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/575fields.set_value to Serializer.set_value by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/576compat.distinct function by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/579fields.logging by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/581RemovedInDRF317Warning by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/578DecimalField normalize_output argument by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/584serializers.LIST_SERIALIZER_KWARGS_REMOVE by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/580represent_timedelta, a function related to CustomScalar by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/586is_already_registered function of BaseRouter by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/587__class_getitem__ of classes by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/585optional_logout csrf_token argument by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/589run_child_validation function of ListSerializer by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/590filters.search_smart_split by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/592UniqueConstraint by @saJaeHyukc in https://github.com/typeddjango/djangorestframework-stubs/pull/591Pattern[str] for RegexField by @Viicos in https://github.com/typeddjango/djangorestframework-stubs/pull/539ModelSerializer.build_standard_field(model_field=) parameter typing by @noamkush in https://github.com/typeddjango/djangorestframework-stubs/pull/541HyperlinkedRelatedField(view_name=) & HyperlinkedIdentityField(view_name=) param optional by @Alexerson in https://github.com/typeddjango/djangorestframework-stubs/pull/530None, empty to ModelSerializer.__init__() default= and initial= kwargs by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/521ViewSetAction.__name__ attribute by @igorgaming in https://github.com/typeddjango/djangorestframework-stubs/pull/567HyperlinkedModelSerializer generic by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/595HyperlinkedRelatedField.get_object() argument types by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/597None for ListField.min/max_length by @Viicos in https://github.com/typeddjango/djangorestframework-stubs/pull/601pre-commit by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/550pytest-mypy-plugins and mypy by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/557stubtest by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/562Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.14.5...3.15.0
mypy 1.7: Recommended mypy version updated to 1.7.x
mypy 1.7: Recommended mypy version updated to 1.7.x
Removed direct mypy dependency. If you are using mypy, please add an explicit mypy dev dependency to your project, or install djangorestframework-stubs with the extra djangorestframework-stubs[compatible-mypy].
Mypy remains the only supported type checker. Improvements for other type checkers may be considered in the future, pull requests welcome. See #1628 for details.
None for several Field constructor arguments by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/498Field subclasses kwargs-only parameters by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/491Serializer.to_representation() return type by @4c0n in https://github.com/typeddjango/djangorestframework-stubs/pull/504BaseSerializer and ListSerializer method to_representation() by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/509http.HTTPMethod enum values in @action() decorator by @sshishov in https://github.com/typeddjango/djangorestframework-stubs/pull/512@cached_property error by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/503Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.14.4...3.14.5
mypy 1.6: Recommended mypy version updated to 1.6.x
mypy 1.6: Recommended mypy version updated to 1.6.x
Next djangorestframework-stubs version (3.14.5) will remove direct mypy dependency. If you are using mypy, please add an explicit mypy dev dependency to your project, or install djangorestframework-stubs with the extra djangorestframework-stubs[compatible-mypy].
Mypy remains the only supported type checker. Improvements for other type checkers may be considered in the future, pull requests welcome. See #1628 for details.
We have now adopted mypy's stubtest to automatically find discrepancies between Django REST Framework and djangorestframework-stubs.
If you want to contribute but are not sure where to start, have a look at stubtest's TODO list file, which lists the many issues discovered by stubtest.
Officially added Python 3.12 support
None for HyperlinkedRelatedField.get_url(format=) parameter by @4c0n in https://github.com/typeddjango/djangorestframework-stubs/pull/485None for Pagination.template attribute by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/482mypy.ini config with django-stubs by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/479None return to __init__ methods by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/492Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.14.3...3.14.4
mypy 1.5: Recommended mypy version updated to 1.5.x
APIClient.credentials method by @ltakens in https://github.com/typeddjango/djangorestframework-stubs/pull/469ReturnDict and ReturnList __init__ signatures by @moosbruggerj in https://github.com/typeddjango/djangorestframework-stubs/pull/452Field.default_error_messages as a ClassVar by @brianhelba in https://github.com/typeddjango/djangorestframework-stubs/pull/464Request.parser_context can never be None by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/476ModelSerializer by @browniebroke in https://github.com/typeddjango/djangorestframework-stubs/pull/444django_stubs_ext was renamed to ext by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/460Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.14.2...3.14.3
mypy 1.4: Recommended mypy version updated to 1.4.x
APIException detail types by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/438pyupgrade from ruff by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/428DjangoContext creation by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/433Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.14.1...3.14.2
Removed long-deprecated Request properties DATA, QUERY_PARAMS by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/420
BaseMetadata.determine_metadata() return type to Any by @realsuayip in https://github.com/typeddjango/djangorestframework-stubs/pull/394RelatedField and subclasses by @nils-van-zuijlen in https://github.com/typeddjango/djangorestframework-stubs/pull/405OrderedDict with dict by @terencehonles in https://github.com/typeddjango/djangorestframework-stubs/pull/414list to abstract Sequence type for http verbs by @namper in https://github.com/typeddjango/djangorestframework-stubs/pull/415Request properties DATA, QUERY_PARAMS by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/420Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/3.14.0...3.14.1
New version scheme: djangorestframework-stubs will now use the same major.minor version number as Django REST Framework.
OrderingFilter.get_default_ordering() return type it may return None by @albertocerrone in https://github.com/typeddjango/djangorestframework-stubs/pull/379APIException input and detail types by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/387Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/1.10.0...3.14.0
This release updates recommended mypy version to 1.1.x.
This release updates recommended mypy version to 1.1.x.
user=None to APIClient.force_authenticate() method by @joshuadavidthomas in https://github.com/typeddjango/djangorestframework-stubs/pull/367django-stubs in requirements.txt by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/376Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/1.9.1...1.10.0
Emergency release to fix packaging issues in yesterday's version.
Emergency release to fix packaging issues in yesterday's version.
For yet unknown reasons, the wheel package of djangorestframework-stubs 1.9.0 also contained the full source code of Django REST Framework version 3.11. Thus installing djangorestframework-stubs 1.9.0 would overwrite djangorestframework files.
To fix an installation with this issue: pip uninstall djangorestframework djangorestframework-stubs && pip install djangorestframework djangorestframework-stubs==1.9.1 (tweak as necessary if you need a particular djangorestframework version)
Thanks to @monosans for debugging this issue. For details, see https://github.com/typeddjango/djangorestframework-stubs/issues/362
pre-commit CI by @sobolevn in https://github.com/typeddjango/djangorestframework-stubs/pull/360Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/1.9.0...1.9.1
This release updates recommended mypy version to 1.0.x.
This release updates recommended mypy version to 1.0.x.
In addition to code contributions, I'd like to thank @PedroPerpetua @sobolevn @mschoettle @piotrszyma for helping out with reviews.
Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/1.8.0...1.9.0
Now testing compatibility with django-stubs 1.13.0, Python 3.10 and mypy 0.991
Now testing compatibility with django-stubs 1.13.0, Python 3.10 and mypy 0.991
Use ImmutableQueryDict for request params by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/237
Make coreapi & markdown requirements optional by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/243
Preserve generic in extended generic views and viewsets by @henribru in https://github.com/typeddjango/djangorestframework-stubs/pull/215
Add missing PageNumberPagination.get_page_number() method by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/263
Fixes #230 - Add missing attributes to APIClient method Response objects by @mattwwarren in https://github.com/typeddjango/djangorestframework-stubs/pull/283
Introduce flake8-pyi in pre-commit checks by @hoefling in https://github.com/typeddjango/djangorestframework-stubs/pull/286
This converts our .pyi files to follow mostly the same conventions as typeshed project, such as new | union syntax and using lowercase types dict/list.
https://github.com/python/typeshed/blob/main/CONTRIBUTING.md#conventions
Add 'HEAD' to accepted HTTP verbs list by @mvandenburgh in https://github.com/typeddjango/djangorestframework-stubs/pull/249
Add DecimalField(normalize_output=) from DRF master by @intgr in https://github.com/typeddjango/djangorestframework-stubs/pull/294
Full Changelog: https://github.com/typeddjango/djangorestframework-stubs/compare/1.7.0...1.8.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Stubs for rest_framework.schemas
rest_framework.schemasrest_framework.filtersrest_framework.documentationFix type annotations for test client
rest_framework.authtoken stubsAdd permissions.pyi, test.pyi and bunch of other modules
permissions.pyi, test.pyi and bunch of other modulesNothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →