Skip to content

Commit 198f633

Browse files
committed
documentation code language fix
1 parent b58e122 commit 198f633

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,33 @@ Ninja JWT can be installed with pip:
3131
Also, you need to register `NinjaJWTDefaultController` controller to you Django-Ninja api.
3232
The `NinjaJWTDefaultController` comes with three routes `obtain_token`, `refresh_token` and `verify_token`
3333

34-
``` {.sourceCode .python}
34+
```python
3535
from ninja_jwt.controller import NinjaJWTDefaultController
3636
from ninja_extra import NinjaExtraAPI
3737

3838
api = NinjaExtraAPI()
39-
api.register_controller(NinjaJWTDefaultController)
39+
api.register_controllers(NinjaJWTDefaultController)
4040

4141
```
4242

4343
The `NinjaJWTDefaultController` comes with three routes `obtain_token`, `refresh_token` and `verify_token`.
4444
It is a combination of two subclass `TokenVerificationController` and `TokenObtainPairController`.
4545
If you wish to customize these routes, you can inherit from these controllers and change its implementation
4646

47-
``` {.sourceCode .python}
47+
```python
4848
from ninja_jwt.controller import TokenObtainPairController, router
4949

5050
@router('token', tags=['Auth']
5151
class MyCustomController(TokenObtainPairController):
5252
"""obtain_token and refresh_token only"
5353
...
54-
api.register_controller(MyCustomController)
54+
api.register_controllers(MyCustomController)
5555
```
5656
5757
If you wish to use localizations/translations, simply add `ninja_jwt` to
5858
`INSTALLED_APPS`.
5959
60-
``` {.sourceCode .python}
60+
```python
6161
INSTALLED_APPS = [
6262
...
6363
'ninja_jwt',

docs/docs/auth_integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Authenticated user can be found in `request.user` or `request.auth`
44

55
### Route Authentication - Class Based
66

7-
``` {.sourceCode .python}
7+
```python
88
from ninja_extra import APIController, router, route
99
from ninja_jwt.authentication import JWTAuth
1010

@@ -17,7 +17,7 @@ class MyController(APIController):
1717

1818
### Route Authentication - Function Based
1919

20-
``` {.sourceCode .python}
20+
```python
2121
from ninja import router
2222
from ninja_jwt import JWTAuth
2323

@@ -34,7 +34,7 @@ If you wish to use a different implementation of `JWTAuth`, then you need to inh
3434
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`.
3535

3636
example:
37-
``` {.sourceCode .python}
37+
```python
3838
from ninja.security import APIKeyHeader
3939
from ninja_jwt.authentication import JWTBaseAuthentication
4040
from ninja import router

docs/docs/blacklist_app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Ninja JWT includes an app that provides token blacklist functionality.
33
To use this app, include it in your list of installed apps in
44
`settings.py`:
55

6-
``` {.sourceCode .python}
6+
```python
77
# Django project settings.py
88

99
...
@@ -33,7 +33,7 @@ points to the `OutstandingToken` record.
3333
Alternatively, you can blacklist a token by creating a `BlacklistMixin`
3434
subclass instance and calling the instance's `blacklist` method:
3535

36-
``` {.sourceCode .python}
36+
```python
3737
from ninja_jwt.tokens import RefreshToken
3838

3939
token = RefreshToken(base64_encoded_token_string)

docs/docs/creating_tokens_manually.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Sometimes, you may wish to manually create a token for a user. This
33
could be done as follows:
44

5-
``` {.sourceCode .python}
5+
```python
66
from ninja_jwt.tokens import RefreshToken
77

88
def get_tokens_for_user(user):

docs/docs/customizing_token_claims.md

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

7-
``` {.sourceCode .python}
7+
```python
88
from ninja_jwt.schema import TokenObtainPairSerializer
99
from ninja_jwt.controller import TokenObtainPairController, router, route
1010
from ninja_schema import Schema
@@ -43,7 +43,7 @@ As with the standard controller, you\'ll also need to include register the contr
4343
If you interested in using functions rather than classes, then you are also covered.
4444
Here is an example
4545

46-
``` {.sourceCode .python}
46+
```python
4747
from ninja import router
4848
from ninja_schema import Schema
4949

@@ -57,7 +57,7 @@ def obtain_token(self, user_token: MyTokenObtainPairSchema):
5757
```
5858

5959
Register the `router` to the django-ninja `api` like so:
60-
``` {.sourceCode .python}
60+
```python
6161
from ninja import NinjaAPI
6262

6363
api = NinjaAPI()

docs/docs/experimental_features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ same token secret key. To use this feature, add the
1313
of the default `JWTAuthentication` backend) to the Django REST
1414
Framework\'s `DEFAULT_AUTHENTICATION_CLASSES` config setting:
1515

16-
``` {.sourceCode .python}
16+
```python
1717
REST_FRAMEWORK = {
1818
...
1919
'DEFAULT_AUTHENTICATION_CLASSES': (

docs/docs/getting_started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,33 @@ Ninja JWT can be installed with pip:
2020
Also, you need to register `NinjaJWTDefaultController` controller to you Django-Ninja api.
2121
The `NinjaJWTDefaultController` comes with three routes `obtain_token`, `refresh_token` and `verify_token`
2222

23-
``` {.sourceCode .python}
23+
```python
2424
from ninja_jwt.controller import NinjaJWTDefaultController
2525
from ninja_extra import NinjaExtraAPI
2626

2727
api = NinjaExtraAPI()
28-
api.register_controller(NinjaJWTDefaultController)
28+
api.register_controllers(NinjaJWTDefaultController)
2929

3030
```
3131

3232
The `NinjaJWTDefaultController` comes with three routes `obtain_token`, `refresh_token` and `verify_token`.
3333
It is a combination of two subclass `TokenVerificationController` and `TokenObtainPairController`.
3434
If you wish to customize these routes, you can inherit from these controllers and change its implementation
3535

36-
``` {.sourceCode .python}
36+
```python
3737
from ninja_jwt.controller import TokenObtainPairController, router
3838

3939
@router('token', tags=['Auth']
4040
class MyCustomController(TokenObtainPairController):
4141
"""obtain_token and refresh_token only"
4242
...
43-
api.register_controller(MyCustomController)
43+
api.register_controllers(MyCustomController)
4444
```
4545
4646
If you wish to use localizations/translations, simply add `ninja_jwt` to
4747
`INSTALLED_APPS`.
4848
49-
``` {.sourceCode .python}
49+
```python
5050
INSTALLED_APPS = [
5151
...
5252
'ninja_jwt',

docs/docs/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Some of Ninja JWT's behavior can be customized through settings
33
variables in `settings.py`:
44

5-
``` {.sourceCode .python}
5+
```python
66
# Django project settings.py
77

88
from datetime import timedelta

docs/docs/token_types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ module if you want to allow both token types to be used for
3838
authentication.)
3939

4040
Also, register `NinjaJWTSlidingController` to the `api`:
41-
``` {.sourceCode .python}
41+
```python
4242
from ninja_jwt.controller import NinjaJWTSlidingController
4343
from ninja_extra import NinjaExtraAPI
4444

4545
api = NinjaExtraAPI()
46-
api.register_controller(NinjaJWTSlidingController)
46+
api.register_controllers(NinjaJWTSlidingController)
4747

4848
```
4949

0 commit comments

Comments
 (0)