Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
96dc9ce1
Commit
96dc9ce1
authored
Oct 31, 2012
by
Otto Yiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing documentation on auth/throttling guides
parent
027c9079
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
docs/api-guide/authentication.md
+3
-3
docs/api-guide/throttling.md
+3
-3
No files found.
docs/api-guide/authentication.md
View file @
96dc9ce1
...
@@ -30,7 +30,7 @@ The default authentication policy may be set globally, using the `DEFAULT_AUTHEN
...
@@ -30,7 +30,7 @@ The default authentication policy may be set globally, using the `DEFAULT_AUTHEN
REST_FRAMEWORK = {
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.
User
BasicAuthentication',
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.SessionAuthentication',
)
)
}
}
...
@@ -38,7 +38,7 @@ The default authentication policy may be set globally, using the `DEFAULT_AUTHEN
...
@@ -38,7 +38,7 @@ The default authentication policy may be set globally, using the `DEFAULT_AUTHEN
You can also set the authentication policy on a per-view basis, using the
`APIView`
class based views.
You can also set the authentication policy on a per-view basis, using the
`APIView`
class based views.
class ExampleView(APIView):
class ExampleView(APIView):
authentication_classes = (SessionAuthentication,
User
BasicAuthentication)
authentication_classes = (SessionAuthentication, BasicAuthentication)
permission_classes = (IsAuthenticated,)
permission_classes = (IsAuthenticated,)
def get(self, request, format=None):
def get(self, request, format=None):
...
@@ -51,7 +51,7 @@ You can also set the authentication policy on a per-view basis, using the `APIVi
...
@@ -51,7 +51,7 @@ 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.
Or, if you're using the
`@api_view`
decorator with function based views.
@api_view(['GET'])
@api_view(['GET'])
@authentication_classes((SessionAuthentication,
User
BasicAuthentication))
@authentication_classes((SessionAuthentication, BasicAuthentication))
@permissions_classes((IsAuthenticated,))
@permissions_classes((IsAuthenticated,))
def example_view(request, format=None):
def example_view(request, format=None):
content = {
content = {
...
...
docs/api-guide/throttling.md
View file @
96dc9ce1
...
@@ -31,8 +31,8 @@ The default throttling policy may be set globally, using the `DEFAULT_THROTTLE_C
...
@@ -31,8 +31,8 @@ The default throttling policy may be set globally, using the `DEFAULT_THROTTLE_C
REST_FRAMEWORK = {
REST_FRAMEWORK = {
'DEFAULT_THROTTLE_CLASSES': (
'DEFAULT_THROTTLE_CLASSES': (
'rest_framework.throttl
es.Anon
Throttle',
'rest_framework.throttl
ing.AnonRate
Throttle',
'rest_framework.throttl
es.User
Throttle'
'rest_framework.throttl
ing.UserRate
Throttle'
),
),
'DEFAULT_THROTTLE_RATES': {
'DEFAULT_THROTTLE_RATES': {
'anon': '100/day',
'anon': '100/day',
...
@@ -136,7 +136,7 @@ For example, given the following views...
...
@@ -136,7 +136,7 @@ For example, given the following views...
REST_FRAMEWORK = {
REST_FRAMEWORK = {
'DEFAULT_THROTTLE_CLASSES'
:
(
'DEFAULT_THROTTLE_CLASSES'
:
(
'rest_framework.throttl
es
.ScopedRateThrottle'
'rest_framework.throttl
ing
.ScopedRateThrottle'
),
),
'DEFAULT_THROTTLE_RATES'
:
{
'DEFAULT_THROTTLE_RATES'
:
{
'
contacts'
:
'
1000/day'
,
'
contacts'
:
'
1000/day'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment