You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,17 @@
10
10
11
11
## Abstract
12
12
13
-
Ninja JWT is JSON Web Token plugin for Django-Ninja. The library is a fork of [Simple JWT](https://github.com/jazzband/djangorestframework-simplejwt) by Jazzband, a popular JWT plugin for [Django REST Framework](http://www.django-rest-framework.org).
13
+
Ninja JWT is a JSON Web Token (JWT) plugin for Django-Ninja.
14
+
This library is a fork of [Simple JWT](https://github.com/jazzband/djangorestframework-simplejwt) by Jazzband,
15
+
a widely-used JWT plugin for the [Django REST Framework](http://www.django-rest-framework.org).
14
16
15
17
#### Notice
16
-
This library does not fix any issues from the source SIMPLE JWT.
17
-
It only added support for Django-Ninja and removes DRF dependencies. And time after time, subsequent updates from SIMPLE JWT will reflect here.
18
18
19
-
For full documentation, [visit](https://eadwincode.github.io/django-ninja-jwt/).
19
+
This library does not address any issues present in the original SIMPLE JWT.
20
+
It only adds support for Django-Ninja and removes dependencies on DRF.
21
+
Subsequent updates from SIMPLE JWT will be reflected here over time.
20
22
23
+
For full documentation, [visit this page](https://eadwincode.github.io/django-ninja-jwt/).
21
24
#### Requirements
22
25
- Python >= 3.6
23
26
- Django >= 2.1
@@ -28,41 +31,40 @@ For full documentation, [visit](https://eadwincode.github.io/django-ninja-jwt/).
28
31
Checkout this sample project: https://github.com/eadwinCode/bookstoreapi
29
32
30
33
31
-
Installation
32
-
============
34
+
## Installation
33
35
34
36
Ninja JWT can be installed with pip:
35
37
36
-
pip install django-ninja-jwt
38
+
```shell
39
+
pip install django-ninja-jwt
40
+
```
37
41
38
-
Also, you need to register `NinjaJWTDefaultController` controller to your Django-Ninja api.
42
+
You also need to register the `NinjaJWTDefaultController` controller to your Django-Ninja API:
39
43
40
44
```python
41
45
from ninja_jwt.controller import NinjaJWTDefaultController
If you wish to use localizations/translations, simply add `ninja_jwt` to
65
-
`INSTALLED_APPS`.
67
+
To use localizations/translations, add `ninja_jwt` to your `INSTALLED_APPS`:
66
68
67
69
```python
68
70
INSTALLED_APPS= [
@@ -73,10 +75,12 @@ INSTALLED_APPS = [
73
75
```
74
76
75
77
## Using Ninja Router
76
-
Also, if you are not interested in following NinjaExtra methodology, check out this doc on how to use `Ninja-JWT` with `Django-Ninja` [here](https://eadwincode.github.io/django-ninja-jwt/customizing_token_claims/#use-django-ninja-router)
77
78
78
-
Usage
79
-
=====
79
+
If you prefer not to follow the NinjaExtra methodology,
80
+
refer to this [documentation](https://eadwincode.github.io/django-ninja-jwt/customizing_token_claims/#use-django-ninja-router)
81
+
on how to use `Ninja-JWT` with `Django-Ninja Router`.
82
+
83
+
## Usage
80
84
81
85
To verify that Ninja JWT is working, you can use curl to issue a couple
Copy file name to clipboardExpand all lines: docs/auth_integration.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
Ninja JWT uses Django Ninja `HttpBearer` as a way to authenticate users reaching your api endpoint.
3
3
Authenticated user can be found in `request.user` or `request.auth`
4
4
5
-
### Route Authentication - Class Based
5
+
### Route Authentication—Class Based
6
6
7
7
```python
8
8
from ninja_extra import api_controller, route
@@ -15,7 +15,7 @@ class MyController:
15
15
...
16
16
```
17
17
18
-
### Route Authentication - Function Based
18
+
### Route Authentication—Function Based
19
19
20
20
```python
21
21
from ninja import router
@@ -28,8 +28,7 @@ def some_endpoint(request):
28
28
...
29
29
```
30
30
31
-
Custom Auth Implement
32
-
-------
31
+
## Custom Auth Implementation
33
32
If you wish to use a different implementation of `JWTAuth`, then you need to inherit from `JWTBaseAuthentication`.
34
33
Please read more on [Django Ninja - Authentication](https://django-ninja.rest-framework.com/tutorial/authentication/), if you want to use a different approach that is not `bearer`.
authentication for [Django Ninja](https://github.com/vitalik/django-ninja).
13
+
Designed to handle common JWT use cases,
14
+
it provides a robust authentication backend with a practical set of default features.
15
+
Additionally, Ninja JWT is highly extensible, allowing developers to add custom features as needed.
12
16
13
-
Ninja JWT provides a JSON Web Token authentication backend for the
14
-
Django Ninja REST Framework. It aims to cover the most common use cases of
15
-
JWTs by offering a conservative set of default features. It also aims to
16
-
be easily extensible in case a desired feature is not present.
17
-
18
-
Acknowledgments
19
-
------
20
-
21
-
This project borrows code from the [SIMPLE JWT](https://github.com/jazzband/djangorestframework-simplejwt) to implement Json Web Token for Django Ninja REST Framework.
22
-
However, I have included SIMPLE JWT license to the `license` folder.
17
+
## Acknowledgments
23
18
19
+
This project utilizes code from [SIMPLE JWT](https://github.com/jazzband/djangorestframework-simplejwt)
20
+
to implement JSON Web Token
21
+
(JWT) for the Django Ninja REST Framework.
22
+
The SIMPLE JWT license is included in the `license` folder.
0 commit comments