Skip to content

Commit 61b476b

Browse files
authored
fix: Docs Typo Errors (#84)
* fixed typo errors in docs * download count update
1 parent 763503d commit 61b476b

File tree

7 files changed

+114
-131
lines changed

7 files changed

+114
-131
lines changed

README.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010

1111
## Abstract
1212

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).
1416

1517
#### 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.
1818

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.
2022

23+
For full documentation, [visit this page](https://eadwincode.github.io/django-ninja-jwt/).
2124
#### Requirements
2225
- Python >= 3.6
2326
- Django >= 2.1
@@ -28,41 +31,40 @@ For full documentation, [visit](https://eadwincode.github.io/django-ninja-jwt/).
2831
Checkout this sample project: https://github.com/eadwinCode/bookstoreapi
2932

3033

31-
Installation
32-
============
34+
## Installation
3335

3436
Ninja JWT can be installed with pip:
3537

36-
pip install django-ninja-jwt
38+
```shell
39+
pip install django-ninja-jwt
40+
```
3741

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:
3943

4044
```python
4145
from ninja_jwt.controller import NinjaJWTDefaultController
4246
from ninja_extra import NinjaExtraAPI
4347

4448
api = NinjaExtraAPI()
4549
api.register_controllers(NinjaJWTDefaultController)
46-
4750
```
4851

49-
The `NinjaJWTDefaultController` comes with three routes `obtain_token`, `refresh_token` and `verify_token`.
50-
It is a combination of two subclasses `TokenVerificationController` and `TokenObtainPairController`.
51-
If you wish to customize these routes, you can inherit from these controllers and change its implementation
52+
The `NinjaJWTDefaultController` includes three routes: `obtain_token`, `refresh_token`, and `verify_token`.
53+
It combines two subclasses, `TokenVerificationController` and `TokenObtainPairController`.
54+
If you want to customize these routes, you can inherit from these controllers and modify their implementation:
5255

5356
```python
5457
from ninja_extra import api_controller
5558
from ninja_jwt.controller import TokenObtainPairController
5659

5760
@api_controller('token', tags=['Auth'])
5861
class MyCustomController(TokenObtainPairController):
59-
"""obtain_token and refresh_token only"
60-
...
62+
"""obtain_token and refresh_token only"""
63+
...
6164
api.register_controllers(MyCustomController)
6265
```
6366

64-
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`:
6668

6769
```python
6870
INSTALLED_APPS = [
@@ -73,10 +75,12 @@ INSTALLED_APPS = [
7375
```
7476

7577
## 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)
7778

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
8084

8185
To verify that Ninja JWT is working, you can use curl to issue a couple
8286
of test requests:

docs/auth_integration.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Ninja JWT uses Django Ninja `HttpBearer` as a way to authenticate users reaching your api endpoint.
33
Authenticated user can be found in `request.user` or `request.auth`
44

5-
### Route Authentication - Class Based
5+
### Route AuthenticationClass Based
66

77
```python
88
from ninja_extra import api_controller, route
@@ -15,7 +15,7 @@ class MyController:
1515
...
1616
```
1717

18-
### Route Authentication - Function Based
18+
### Route AuthenticationFunction Based
1919

2020
```python
2121
from ninja import router
@@ -28,8 +28,7 @@ def some_endpoint(request):
2828
...
2929
```
3030

31-
Custom Auth Implement
32-
-------
31+
## Custom Auth Implementation
3332
If you wish to use a different implementation of `JWTAuth`, then you need to inherit from `JWTBaseAuthentication`.
3433
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`.
3534

docs/customizing_token_claims.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ views, create a subclass for the desired controller as well as a subclass for
44
its corresponding serializer. Here\'s an example :
55

66
!!! info
7-
if you are interested in Asynchronous version of the class, use `AsyncNinjaJWTDefaultController` and `AsyncNinjaJWTSlidingController`.
8-
Also note, it's only available for Django versions that supports asynchronous actions.
7+
if you are interested in an Asynchronous version of the class, use `AsyncNinjaJWTDefaultController` and `AsyncNinjaJWTSlidingController`.
8+
Also note, it's only available for Django versions that support asynchronous actions.
99

1010
```python
1111
from ninja_jwt.schema import TokenObtainPairInputSchema
@@ -46,7 +46,7 @@ As with the standard controller, you\'ll also need to include register the contr
4646

4747
#### Use Django Ninja Router
4848

49-
If you interested in using functions rather than classes, then you are also covered.
49+
If you are interested in using functions rather than classes, then you are also covered.
5050
Here is an example
5151

5252
```python

docs/getting_started.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ INSTALLED_APPS = [
5353
]
5454
```
5555
56-
Usage
57-
=====
56+
## Using Ninja Router
57+
58+
If you prefer not to follow the NinjaExtra methodology,
59+
refer to this [documentation](https://eadwincode.github.io/django-ninja-jwt/customizing_token_claims/#use-django-ninja-router)
60+
on how to use `Ninja-JWT` with `Django-Ninja Router`.
61+
62+
## Usage
5863
5964
To verify that Ninja JWT is working, you can use curl to issue a couple
6065
of test requests:
@@ -96,8 +101,7 @@ curl \
96101
{"access":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX3BrIjoxLCJ0b2tlbl90eXBlIjoiYWNjZX...", "refresh":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX3BrIjoxLCJ0b2tlbl90eXBlIjoicmVm..."}
97102
```
98103
99-
Cryptographic Dependencies (Optional)
100-
-------------------------------------
104+
## Cryptographic Dependencies (Optional)
101105
102106
If you are planning on encoding or decoding tokens using certain digital
103107
signature algorithms (i.e. RSA and ECDSA; visit PyJWT for other algorithms), you will need to install the
@@ -107,7 +111,7 @@ extra in the `django-ninja-jwt` requirement:
107111
pip install django-ninja-jwt[crypto]
108112
109113
110-
The `django-ninja-jwt[crypto]` format is recommended in requirements
114+
The `django-ninja-jwt[crypto]` format is recommended in requirement
111115
files in projects using `Ninja JWT`, as a separate `cryptography` requirement
112116
line may later be mistaken for an unused requirement and removed.
113117
[cryptography](https://cryptography.io)

docs/index.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44
[![PyPI version](https://img.shields.io/pypi/v/django-ninja-jwt.svg)](https://pypi.python.org/pypi/django-ninja-jwt)
55
[![PyPI version](https://img.shields.io/pypi/pyversions/django-ninja-jwt.svg)](https://pypi.python.org/pypi/django-ninja-jwt)
66
[![PyPI version](https://img.shields.io/pypi/djversions/django-ninja-jwt.svg)](https://pypi.python.org/pypi/django-ninja-jwt)
7-
[![Downloads](https://static.pepy.tech/personalized-badge/django-ninja-jwt?period=month&units=international_system&left_color=black&right_color=yellow&left_text=Downloads)](https://pepy.tech/project/django-ninja-jwt)
7+
[![Downloads](https://static.pepy.tech/badge/django-ninja-jwt)](https://pepy.tech/project/django-ninja-jwt)
88

9-
A JSON Web Token authentication plugin for the [Django Ninja REST Framework](https://github.com/vitalik/django-ninja).
9+
## Introduction
1010

11-
------------------------------------------------------------------------
11+
The Ninja JWT plugin offers JSON Web Token (JWT)
12+
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.
1216

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
2318

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

Comments
 (0)