aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/authentication.md
diff options
context:
space:
mode:
authorTom Christie2012-09-30 15:55:24 +0100
committerTom Christie2012-09-30 15:55:24 +0100
commit43d3634e892e303ca377265d3176e8313f19563f (patch)
treed98dc72a40ee384888e436d4fce842b505798f65 /docs/api-guide/authentication.md
parent616e6f5f4d747e3be7e5ca2efe72872ed586bd3d (diff)
downloaddjango-rest-framework-43d3634e892e303ca377265d3176e8313f19563f.tar.bz2
Docs tweaking
Diffstat (limited to 'docs/api-guide/authentication.md')
-rw-r--r--docs/api-guide/authentication.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md
index f24c6a81..c6995360 100644
--- a/docs/api-guide/authentication.md
+++ b/docs/api-guide/authentication.md
@@ -39,6 +39,7 @@ You can also set the authentication policy on a per-view basis, using the `APIVi
class ExampleView(APIView):
authentication_classes = (SessionAuthentication, UserBasicAuthentication)
+ permission_classes = (IsAuthenticated,)
def get(self, request, format=None):
content = {
@@ -49,10 +50,9 @@ You can also set the authentication policy on a per-view basis, using the `APIVi
Or, if you're using the `@api_view` decorator with function based views.
- @api_view(
- allowed=('GET',),
- authentication_classes=(SessionAuthentication, UserBasicAuthentication)
- )
+ @api_view('GET'),
+ @authentication_classes(SessionAuthentication, UserBasicAuthentication)
+ @permissions_classes(IsAuthenticated)
def example_view(request, format=None):
content = {
'user': unicode(request.user), # `django.contrib.auth.User` instance.