Django-ninja

Latest version: v1.4.0

Safety actively analyzes 723144 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 7

0.20.0

What's Changed
* Speedup code reload by hiaselhans in https://github.com/vitalik/django-ninja/pull/624
* Added a support for openapi ServerObject by Vaiders in https://github.com/vitalik/django-ninja/pull/574
* Fix url_namespace -> urls_namespace msg by SmileyChris in https://github.com/vitalik/django-ninja/pull/519
* add --sorted flag to export_openapi_schema by hiaselhans in https://github.com/vitalik/django-ninja/pull/571
* Set correct media type in docs for custom renderer by Svenito in https://github.com/vitalik/django-ninja/pull/598
* Update swagger UI to 4.14.0 by kabell in https://github.com/vitalik/django-ninja/pull/553
*
Documentation
* Shuffle doc files around by vpoulailleau in https://github.com/vitalik/django-ninja/pull/543
* Fix README link to "async support" by denizdogan in https://github.com/vitalik/django-ninja/pull/545
* Add repository url in `pyproject.toml` by baseplate-admin in https://github.com/vitalik/django-ninja/pull/563
* Set up doc search by tssujt in https://github.com/vitalik/django-ninja/pull/572

Misc
* remove python 3.6 by hiaselhans in https://github.com/vitalik/django-ninja/pull/625
* Bump actions/checkout from 2 to 3 by dependabot in https://github.com/vitalik/django-ninja/pull/411
* Bump actions/setup-python from 2 to 4 by dependabot in https://github.com/vitalik/django-ninja/pull/493
* Fix failing `flit` build by baseplate-admin in https://github.com/vitalik/django-ninja/pull/564

New Contributors
* vpoulailleau made their first contribution in https://github.com/vitalik/django-ninja/pull/543
* denizdogan made their first contribution in https://github.com/vitalik/django-ninja/pull/545
* baseplate-admin made their first contribution in https://github.com/vitalik/django-ninja/pull/563
* hiaselhans made their first contribution in https://github.com/vitalik/django-ninja/pull/571
* Svenito made their first contribution in https://github.com/vitalik/django-ninja/pull/598
* Vaiders made their first contribution in https://github.com/vitalik/django-ninja/pull/574
* kabell made their first contribution in https://github.com/vitalik/django-ninja/pull/553

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v0.19.1...v0.20.0

0.19.1

What's Changed

* Declare the AuthenticationError exception class in __all__ by duducp in https://github.com/vitalik/django-ninja/pull/489
* Small fix for many2many payloads to allow passing primary keys for model fields

Documentation
* Docs restructure by SmileyChris in https://github.com/vitalik/django-ninja/pull/334
* Add documentation on the `.from_orm` method by cltrudeau in https://github.com/vitalik/django-ninja/pull/503
* Added mutiple items example by ihelmer07 in https://github.com/vitalik/django-ninja/pull/509


New Contributors
* cltrudeau made their first contribution in https://github.com/vitalik/django-ninja/pull/503
* ihelmer07 made their first contribution in https://github.com/vitalik/django-ninja/pull/509

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v.0.19.0...v0.19.1

v.0.19.0
What's Changed

* docs decorator by vitalik in https://github.com/vitalik/django-ninja/pull/488
* Allow arbitrary Pagination Output ( alternative 464 rafonseca ) by vitalik in https://github.com/vitalik/django-ninja/pull/483
* Update Redoc related documents by tssujt in https://github.com/vitalik/django-ninja/pull/462
* Improves authentication validation to throw an exception by duducp in https://github.com/vitalik/django-ninja/pull/454
* Add TestClient note to multiple APIs warning by srcreigh in https://github.com/vitalik/django-ninja/pull/416
* Implement implicit reverse url name generation by SmileyChris in https://github.com/vitalik/django-ninja/pull/361
* Also pass the router to `get_operation_url_name` by SmileyChris in https://github.com/vitalik/django-ninja/pull/486
* [feat] add superuser session authentication only by areski in https://github.com/vitalik/django-ninja/pull/351


New Contributors
* tssujt made their first contribution in https://github.com/vitalik/django-ninja/pull/462
* duducp made their first contribution in https://github.com/vitalik/django-ninja/pull/454
* srcreigh made their first contribution in https://github.com/vitalik/django-ninja/pull/416
* areski made their first contribution in https://github.com/vitalik/django-ninja/pull/351

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v.0.18.0...v.0.19.0

v.0.18.0
Hello

Please welcome the new Django Ninja version
it has lot of fixes and improvements

Most notable a HttpResponse typed argument by SmileyChris

Now you can manage response behaviour (cookies, headers, streaming) flixible:

Python
api.post("/boop")
def boop(request, response: HttpResponse): !
response.set_cookie("beep", "boop") !
return True


All changes
* Provide a temporal HttpResponse typed argument to views by SmileyChris in https://github.com/vitalik/django-ninja/pull/336
* UploadedFile inherit from Django's UploadedFile by OtherBarry in https://github.com/vitalik/django-ninja/pull/400
* Allow path parameters to be specified at router level by kaschnit in https://github.com/vitalik/django-ninja/pull/369
* Added support for postgress specific fields to Model Schema 353
* Fixed openapi/pydantic versions compatibility 418
* pre-commit config by SmileyChris in https://github.com/vitalik/django-ninja/pull/364
* Access to test response attributes by stephane in https://github.com/vitalik/django-ninja/pull/402
* Small optimization and typing improvements by SmileyChris in https://github.com/vitalik/django-ninja/pull/367
* Minor typo in tutorial by stephane in https://github.com/vitalik/django-ninja/pull/387
* Specify mypy in CONTRIBUTING.md by OtherBarry in https://github.com/vitalik/django-ninja/pull/401
* ConfigError: ModelSchema classes requires a 'Config' subclass by sebastian-philipp in https://github.com/vitalik/django-ninja/pull/382
* Fix a typing issue by HoJin9622 in https://github.com/vitalik/django-ninja/pull/404
* Fix a few typos by dy3l in https://github.com/vitalik/django-ninja/pull/426
* Add Redoc support by kxxoling in https://github.com/vitalik/django-ninja/pull/427
* Fix typo in docs by sho918 in https://github.com/vitalik/django-ninja/pull/432
* Handle class instances in `signature.details.is_collection_type` by flaeppe in https://github.com/vitalik/django-ninja/pull/434
* Upgrade versions of pre-commit hooks by flaeppe in https://github.com/vitalik/django-ninja/pull/435

New Contributors
* kaschnit made their first contribution in https://github.com/vitalik/django-ninja/pull/369
* stephane made their first contribution in https://github.com/vitalik/django-ninja/pull/387
* OtherBarry made their first contribution in https://github.com/vitalik/django-ninja/pull/400
* sebastian-philipp made their first contribution in https://github.com/vitalik/django-ninja/pull/382
* HoJin9622 made their first contribution in https://github.com/vitalik/django-ninja/pull/404
* dy3l made their first contribution in https://github.com/vitalik/django-ninja/pull/426
* kxxoling made their first contribution in https://github.com/vitalik/django-ninja/pull/427
* sho918 made their first contribution in https://github.com/vitalik/django-ninja/pull/432
* flaeppe made their first contribution in https://github.com/vitalik/django-ninja/pull/434

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v0.17.0...v0.18.0

0.17.0

This release brings few long awaited features:

Smarter schema

Now you can access orm instance attributes inside schema with **resolvers**:
Python
class TaskSchema(Schema):
title: str
is_completed: bool
owner: Optional[str]
lower_title: str

staticmethod
def resolve_owner(obj): <------- !!!!!!
if not obj.owner:
return
return f"{obj.owner.first_name} {obj.owner.last_name}"

def resolve_lower_title(self, obj): <-------- !!!!!!
return self.title.lower()


Field **aliases** now support django template variables dotted syntax:

Python
class TaskSchema(Schema):
...
last_comment: str = Field(..., alias="comment_set.0.text")


Thanks to SmileyChris


Pagination output

Now default paginated output returns a dict with `items` and `count`

You can now override both input and output schemas for custom pagination:

Python
class CustomPagination(PaginationBase):

class Input(Schema):
page: int

class Output(Schema):
items: List[Any]
total_pages: int
current_page: int

def paginate_queryset(self, queryset, pagination: Input, **params):
return {
'items': ...,
'total_pages': ...,
'current_page': ...,
}



All updates:
* Improved pagination by vitalik
* Smarter schema that handles dotted aliases and resolver methods by SmileyChris 317
* Add support for union type in payload by AkeemMcLennon 301
* Export OpenAPI schema management cmd by stefanitsky 288
* First key derivation optimization by mom1 344
* `**kwargs` not required anymore for pagination by mom1 285

New Contributors
* AkeemMcLennon
* stefanitsky
* mom1

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v0.16.2...v0.17.0

0.16.2

- Pydantic 1.9.0 support 310 by antonrh
- Fix params descriptions visualization in swagger ui 331 by ldbenitez
- Improve TestClient json argument-serialization 315 by johnbergvall
- Add python 3.10 to test matrix 273 by jairhenrique
- Automate github actions update. 274 by jairhenrique


Many documentaion fixes and improvements by:
- daviddavis
- shamaevnn
- SmileyChris
- antonrh
- s3lcuk
- idahogray
- TaeHyoungKwon
- dekoza

0.16.1

- Resolve 229 & 240 reporting dev errors under django dev-server (242 by stephenrauch)
- Allow NOT_SET to survive copy.deepcopy() (241 by stephenrauch)

0.16.0

**OpenAPI schemas names**

Generating OpenAPI automatically created schema names changed for duplicated names (see 230)
Now instead of silence (or exceptions on other cases) django-ninja will just add sequential number suffix to the schema name in OpenAPI spec.
For example if you already have schema called "User" and in some other module you create another "User" schema - the second will have name "User2" in openapi json.

**Other**
- Dot in query regression 238 (239 by stephenrauch)
- Fix openapi schema title and description propagation for query, cookie, header, etc 123 (233 from stephenrauch)
- Fix form schema single param 236 (237 from stephenrauch)
- Improve 181, query with list type (234 by stephenrauch)
- Path signature check (232 by stephenrauch)
- Document how to handle empty form fields (228 by stephenrauch)
- Misc fixes (231 by ehdgua01)

Page 4 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.