Django-ninja

Latest version: v1.3.0

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

Scan your dependencies

Page 2 of 7

1.0

Read more details and examples here https://django-ninja.dev/whatsnew_v1/

or watch overview video :


<a href="https://youtu.be/GrIpDXPG41o"><img width="500" alt="SCR-20231116-qmoj" src="https://github.com/vitalik/django-ninja/assets/95222/06958fbf-6d3a-4f33-aa76-7a29279c9959"></a>



Overview

- **async authentication** fully supported on all layers
- New parameters markers syntax (+ **`Annotated[]`** syntax support)
- **CSRF is now automatic** on Cookie based authentication ( now you should be able to combine multiple cookie/header/etc authenticators and play around with csrf logic)
- **Pydantic2** - which has a core re-written in Rust and includes a lot of improvements and features like:
- Safer types.
- Better extensibility.
- Better performance - so far on few projects that I tested getting average 10% speed improvements (some particular views which do lot of validations should get pretty good bumps)
- schema validators/resolvers now have extra context (like request)
- Pagination class accepts a request object
- allow adding routers by string path instead of explicit import

Unfortunately Django ninja integrates very deep into pydantic core with Schema class, so it is not possible to keep both pydantic v1 and v2 supported - and that is why ninja now bumps to version 1 which might have few deprecations or breaking changes on pydantic level

From Django ninja side I tried to make this upgrade as smooth as possible, if you use standard APIs without lot of magic - most likely upgrade should be without any code change



Contributors

AlTosterino
AmiZya
Kristinus
ddahan
dipbazz
ivoire
lilleswing
marius-mather
pavel-beaufort
pawelngei
scott-8
skokado
vincentdavis
vpoulailleau
yasoob

Thank you !

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v0.22.2...v1.0

1.0rc

What's Changed
* Fixed not awaitable response in async authentication (44)

This looks like the final pre-release - and I'm happy to report that beta versions was successfully tested by multiple companies in production environments


What's new in 1.x

- **async authentication** fully supported on all layers
- New parameters markers syntax (+ **`Annotated[]`** syntax support)
- **CSRF is now automatic** on Cookie based authentication ( now you should be able to combine multiple cookie/header/etc authenticators and play around with csrf logic)
- **Pydantic2** - which has a core re-written in Rust and includes a lot of improvements and features like:
- Safer types.
- Better extensibility.
- Better performance - so far on few projects that I tested getting average 10% speed improvements (some particular views which do lot of validations should get pretty good bumps)
- schema validators/resolvers now have extra context (like request)
- Pagination class accepts a request object
- allow adding routers by string path instead of explicit import

Unfortunately Django ninja integrates very deep into pydantic core with Schema class, so it is not possible to keep both pydantic v1 and v2 supported - and that is why ninja now bumps to version 1 which might have few deprecations or breaking changes on pydantic level

From Django ninja side I'm trying to make this upgrade as smooth as possible, if you use standard APIs without lot of magic - most likely upgrade should be without any code change



Documentation
* Fix spelling error in motivation documentation by lilleswing in https://github.com/vitalik/django-ninja/pull/874
* Add partial updates and strict validation to the CRUD tutorial by ddahan in https://github.com/vitalik/django-ninja/pull/877
* docs: configure syntax coloring by ivoire in https://github.com/vitalik/django-ninja/pull/878
* docs: use lowercase for language identifier by ivoire in https://github.com/vitalik/django-ninja/pull/879

New Contributors
* lilleswing made their first contribution in https://github.com/vitalik/django-ninja/pull/874
* ddahan made their first contribution in https://github.com/vitalik/django-ninja/pull/877
* ivoire made their first contribution in https://github.com/vitalik/django-ninja/pull/878

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v1.0b2...v1.0rc

1.0b2

Warning: This is a pre-release of Django Ninja V1

This is the last change before 1.x release

This version introduces a new cleaner way to mark requests parameters


f.e.

Python
def some_form(request, data: Form[SomeSchema]):
...


instead of

Python
def some_form(request, data: SomeSchema = Form(...)):
...


This syntax looks cleaner/short and has the same code completion hints in popular editors.

On the other hand the old syntax is still supported so you can easy port your project to a newer django-ninja version



Bug changes and improvements
* Forbid extra by nofalx in https://github.com/vitalik/django-ninja/pull/863
* Add a test for list query params by marius-mather in https://github.com/vitalik/django-ninja/pull/852
* (docs) Fix typo in path-params.md by dipbazz in https://github.com/vitalik/django-ninja/pull/854
* (docs) Fix note to be admonitions in query-params.md by dipbazz in https://github.com/vitalik/django-ninja/pull/855

---

What's new in 1.x

- **async authentication** fully supported on all layers
- **CSRF is now automatic** on Cookie based authentication ( now you should be able to combine multiple cookie/header/etc authenticators and play around with csrf logic)
- **Pydantic2** - which has a core re-written in Rust and includes a lot of improvements and features like:
- Safer types.
- Better extensibility.
- Better performance - so far on few projects that I tested getting average 10% speed improvements (some particular views which do lot of validations should get pretty good bumps)
- schema validators/resolvers now have extra context (like request)
- Pagination class accepts a request object
- Support for **`Annotated[]`** syntax
- allow adding routers by string path instead of explicit import

Unfortunately Django ninja integrates very deep into pydantic core with Schema class, so it is not possible to keep both pydantic v1 and v2 supported - and that is why ninja now bumps to version 1 which might have few deprecations or breaking changes on pydantic level

From Django ninja side I'm trying to make this upgrade as smooth as possible, if you use standard APIs without lot of magic - most likely upgrade should be without any code change





New Contributors
* marius-mather made their first contribution in https://github.com/vitalik/django-ninja/pull/852
* dipbazz made their first contribution in https://github.com/vitalik/django-ninja/pull/854
* nofalx made their first contribution in https://github.com/vitalik/django-ninja/pull/863

**Full Changelog**: https://github.com/vitalik/django-ninja/compare/v1.0b1...v1.0b2

1.0b1

Warning: This is a pre-release of Django Ninja V1

On the other hand this is a beta release, so no more dramatic changes expected - mostly bug fixes

**There is only one major syntax thing that I'm still considering to add to 1.0 - shorter annotations - 746 - Please take a look and give your vote/thoughts**

---

What's new

- **async authentication** fully supported on all layers
- **CSRF is now automatic** on Cookie based authentication ( now you should be able to combine multiple cookie/header/etc authenticators and play around with csrf logic)
- **Pydantic2** - which has a core re-written in Rust and includes a lot of improvements and features like:
- Safer types.
- Better extensibility.
- Better performance - so far on few projects that I tested getting average 10% speed improvements (some particular views which do lot of validations should get pretty good bumps)
- schema validators/resolvers now have extra context (like request)
- Pagination class accepts a request object
- Support for **`Annotated[]`** syntax
- allow adding routers by string path instead of explicit import

Unfortunately Django ninja integrates very deep into pydantic core with Schema class, so it is not possible to keep both pydantic v1 and v2 supported - and that is why ninja now bumps to version 1 which might have few deprecations or breaking changes on pydantic level

From Django ninja side I'm trying to make this upgrade as smooth as possible, if you use standard APIs without lot of magic - most likely upgrade should be without any code change


Many thanks to contributors
* OtherBarry
* baseplate-admin
* vpoulailleau
* pavel-beaufort
* pawelngei
* Kristinus
* AlTosterino
* yasoob

1.0a3

Warning: This is a pre-release of Django Ninja V1

You probably should not use this version in production

----

What's new v1a3

- Fixed pydantic context serialisation 825

What's new v1a2

- Pagination class accepts a request object

What's new v1a1

- **async authentication** fully supported on all layers
- **CSRF is now automatic** on Cookie based authentication ( now you should be able to combine multiple cookie/header/etc authenticators and play around with csrf logic)
- **Pydantic2** - which has a core re-written in Rust and includes a lot of improvements and features like:
- Safer types.
- Better extensibility.
- Better performance - so far on few projects that I tested getting average 10% speed improvements (some particular views which do lot of validations should get pretty good bumps)

Unfortunately Django ninja integrates very deep into pydantic core with Schema class, so it is not possible to keep both pydantic v1 and v2 supported - and that is why ninja now bumps to version 1 which might have few deprecations or breaking changes on pydantic level

From Django ninja side I'm trying to make this upgrade as smooth as possible, if you use standard APIs without lot of magic - most likely upgrade should be without any code change

1.0a2

Warning: This is a pre-release of Django Ninja V1

You probably should not use this version in production

----

What's new v1a2

- Pagination class accepts a request object

What's new v1a1

- **async authentication** fully supported on all layers
- **CSRF is now automatic** on Cookie based authentication ( now you should be able to combine multiple cookie/header/etc authenticators and play around with csrf logic)
- **Pydantic2** - which has a core re-written in Rust and includes a lot of improvements and features like:
- Safer types.
- Better extensibility.
- Better performance - so far on few projects that I tested getting average 10% speed improvements (some particular views which do lot of validations should get pretty good bumps)

Unfortunately Django ninja integrates very deep into pydantic core with Schema class, so it is not possible to keep both pydantic v1 and v2 supported - and that is why ninja now bumps to version 1 which might have few deprecations or breaking changes on pydantic level

From Django ninja side I'm trying to make this upgrade as smooth as possible, if you use standard APIs without lot of magic - most likely upgrade should be without any code change

Page 2 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.