Skip to content

Commit 3a70eb2

Browse files
authored
1 parent cfc067b commit 3a70eb2

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

docs/api-guide/authentication.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ Unauthenticated responses that are denied permission will result in an `HTTP 403
293293

294294
If you're using an AJAX-style API with SessionAuthentication, you'll need to make sure you include a valid CSRF token for any "unsafe" HTTP method calls, such as `PUT`, `PATCH`, `POST` or `DELETE` requests. See the [Django CSRF documentation][csrf-ajax] for more details.
295295

296-
**Warning**: Always use Django's standard login view when creating login pages. This will ensure your login views are properly protected.
296+
!!! warning
297+
Always use Django's standard login view when creating login pages. This will ensure your login views are properly protected.
297298

298299
CSRF validation in REST framework works slightly differently from standard Django due to the need to support both session and non-session based authentication to the same views. This means that only authenticated requests require CSRF tokens, and anonymous requests may be sent without CSRF tokens. This behavior is not suitable for login views, which should always have CSRF validation applied.
299300

docs/api-guide/renderers.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,10 @@ Modify your REST framework settings.
444444

445445
[REST framework JSONP][rest-framework-jsonp] provides JSONP rendering support. It was previously included directly in the REST framework package, and is now instead supported as a third-party package.
446446

447-
---
448-
449-
**Warning**: If you require cross-domain AJAX requests, you should generally be using the more modern approach of [CORS][cors] as an alternative to `JSONP`. See the [CORS documentation][cors-docs] for more details.
447+
!!! warning
448+
If you require cross-domain AJAX requests, you should generally be using the more modern approach of [CORS][cors] as an alternative to `JSONP`. See the [CORS documentation][cors-docs] for more details.
450449

451-
The `jsonp` approach is essentially a browser hack, and is [only appropriate for globally readable API endpoints][jsonp-security], where `GET` requests are unauthenticated and do not require any user permissions.
452-
453-
---
450+
The `jsonp` approach is essentially a browser hack, and is [only appropriate for globally readable API endpoints][jsonp-security], where `GET` requests are unauthenticated and do not require any user permissions.
454451

455452
#### Installation & configuration
456453

docs/api-guide/viewsets.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ Typically we wouldn't do this, but would instead register the viewset with a rou
5757
router.register(r'users', UserViewSet, basename='user')
5858
urlpatterns = router.urls
5959

60-
**Warning**: Do not use `.as_view()` with `@action` methods. It bypasses router setup and may ignore action settings like `permission_classes`. Use `DefaultRouter` for actions.
60+
!!! warning
61+
Do not use `.as_view()` with `@action` methods. It bypasses router setup and may ignore action settings like `permission_classes`. Use `DefaultRouter` for actions.
6162

6263
Rather than writing your own viewsets, you'll often want to use the existing base classes that provide a default set of behavior. For example:
6364

docs_theme/css/default.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,4 +452,16 @@ ul.sponsor {
452452
margin: 0 -.6rem 1em;
453453
padding: 0.4rem 0.6rem;
454454
}
455+
.admonition.warning {
456+
border: .075rem solid #ff9844;
457+
}
458+
.admonition.warning .admonition-title {
459+
background: #ff98441a;
460+
}
461+
.admonition.danger {
462+
border: .075rem solid #f63a3a;
463+
}
464+
.admonition.danger .admonition-title {
465+
background: #f63a3a1a;
466+
}
455467

0 commit comments

Comments
 (0)