diff --git a/docs/docs/guides/api-docs.md b/docs/docs/guides/api-docs.md index 16e26be94..fc6c36635 100644 --- a/docs/docs/guides/api-docs.md +++ b/docs/docs/guides/api-docs.md @@ -101,7 +101,7 @@ In a Django template, for example: ## Creating custom docs viewer -To create your own view for OpenaAPI - create a class inherited from DocsBase and overwrite `render_page` method: +To create your own view for OpenAPI - create a class inherited from DocsBase and overwrite `render_page` method: ```python form ninja.openapi.docs import DocsBase diff --git a/docs/docs/guides/async-support.md b/docs/docs/guides/async-support.md index e6adcac3d..5273f3a2c 100644 --- a/docs/docs/guides/async-support.md +++ b/docs/docs/guides/async-support.md @@ -187,7 +187,7 @@ async def search(request, post_id: int): ... ``` -There is a common **GOTCHA**: Django queryset's are lazily evaluated (database query happens only when you start iterating), so this will **not** work: +There is a common **GOTCHA**: Django querysets are lazily evaluated (database query happens only when you start iterating), so this will **not** work: ```python all_blogs = await sync_to_async(Blog.objects.all)() diff --git a/docs/docs/guides/errors.md b/docs/docs/guides/errors.md index 6766603f1..de3b6ea0d 100644 --- a/docs/docs/guides/errors.md +++ b/docs/docs/guides/errors.md @@ -8,8 +8,8 @@ Let's say you are making API that depends on some external service that is desig To achieve that you need: - - 1) create some exception (or use existing one) - - 2) use api.exception_handler decorator +1. create some exception (or use existing one) +2. use api.exception_handler decorator Example: diff --git a/docs/docs/guides/response/config-pydantic.md b/docs/docs/guides/response/config-pydantic.md index 57b34aac0..aff7a260e 100644 --- a/docs/docs/guides/response/config-pydantic.md +++ b/docs/docs/guides/response/config-pydantic.md @@ -33,7 +33,7 @@ class CamelModelSchema(Schema): !!! note When overriding the schema's `Config`, it is necessary to inherit from the base `Config` class. -Keep in mind that when you want modify output for field names (like cammel case) - you need to set as well `populate_by_name` and `by_alias` +Keep in mind that when you want modify output for field names (like camel case) - you need to set as well `populate_by_name` and `by_alias` ```python hl_lines="6 9" class UserSchema(ModelSchema): diff --git a/docs/docs/guides/response/pagination.md b/docs/docs/guides/response/pagination.md index 68683d541..1e79181fc 100644 --- a/docs/docs/guides/response/pagination.md +++ b/docs/docs/guides/response/pagination.md @@ -186,7 +186,7 @@ def items(request): return MyModel.objects.all() @router.get("/other-items", response=List[OtherSchema]) -def ohter_items(request): +def other_items(request): return OtherModel.objects.all() ``` diff --git a/docs/docs/guides/throttling.md b/docs/docs/guides/throttling.md index 92db4fd24..cf72f088c 100644 --- a/docs/docs/guides/throttling.md +++ b/docs/docs/guides/throttling.md @@ -72,7 +72,7 @@ Will throttle users (**if you use django build-in user authentication**) to a gi ### AuthRateThrottle -Will throttle by Django ninja [authentication](guides/authentication.md) to a given rate of requests across the API. Unauthenticated requests will fall back to using the IP address of the incoming request to generate a unique key to throttle against. +Will throttle by Django ninja [authentication](authentication.md) to a given rate of requests across the API. Unauthenticated requests will fall back to using the IP address of the incoming request to generate a unique key to throttle against. Note: the cache key in case of `request.auth` will be generated by `sha256(str(request.auth))` - so if you returning some custom objects inside authentication make sure to implement `__str__` method that will return a unique value for the user. diff --git a/docs/docs/reference/operations-parameters.md b/docs/docs/reference/operations-parameters.md index 3e0e9b19d..5660778e5 100644 --- a/docs/docs/reference/operations-parameters.md +++ b/docs/docs/reference/operations-parameters.md @@ -2,7 +2,7 @@ ## OpenAPI Schema related -The following parameters interact with the how the OpenAPI schema (and docs) are generated. +The following parameters interact with how the OpenAPI schema (and docs) are generated. ### `tags` @@ -244,5 +244,5 @@ api = NinjaAPI( ] ) ``` -This will allow switching between enviroments when using interactive OpenAPI docs: +This will allow switching between environments when using interactive OpenAPI docs: ![Servers](../img/servers.png) diff --git a/docs/docs/whatsnew_v1.md b/docs/docs/whatsnew_v1.md index ec38828b4..c0a3413ec 100644 --- a/docs/docs/whatsnew_v1.md +++ b/docs/docs/whatsnew_v1.md @@ -99,10 +99,10 @@ def some_form(request, data: AuthSchema = Form(...)): -with all the the autocompletion in editors +with all the autocompletion in editors -On the other hand the **old syntax is still supported** so you can easy port your project to a newer django-ninja version without much haste +On the other hand the **old syntax is still supported** so you can easily port your project to a newer django-ninja version without much haste #### + Annotated @@ -134,7 +134,7 @@ class Auth(HttpBearer): ## Changed CSRF Behavior -`csrf=True` requirement is no longer required if you use cookie based authentication. Instead CSRF protection is enabled automatically. This also allow you to mix csrf-protected authenticators and other methods that does not requrie cookies: +`csrf=True` requirement is no longer required if you use cookie based authentication. Instead CSRF protection is enabled automatically. This also allow you to mix csrf-protected authenticators and other methods that does not require cookies: ```Python api = NinjaAPI(auth=[django_auth, Auth()]) @@ -179,7 +179,7 @@ api.add_router('/app5', 'myproject.app5.router') ## Decorators -When django ninja decorates a view with .get/.post etc - it wraps the result of the function (which in most cases are not HttpResponse - but some serializable object) so it's not really possible to use some built-in or 3rd-party decorators like: +When django ninja decorates a view with .get/.post etc. - it wraps the result of the function (which in most cases are not HttpResponse - but some serializable object) so it's not really possible to use some built-in or 3rd-party decorators like: ```python hl_lines="4" from django.views.decorators.cache import cache_page