aboutsummaryrefslogtreecommitdiffstats
path: root/pysite
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-08-15 21:26:32 +0200
committerGravatar Johannes Christ <[email protected]>2018-08-15 21:26:32 +0200
commiteeeb3acb867fc47170051b3effbe8a9b43f3ab2e (patch)
tree70880fc2a28274293cc2e2f1efcfc075270cfa6a /pysite
parentUse `TokenAuthentication` instead of API keys. (diff)
Require authentication to use the API.
Diffstat (limited to 'pysite')
-rw-r--r--pysite/settings.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pysite/settings.py b/pysite/settings.py
index 914fcbe5..3392426d 100644
--- a/pysite/settings.py
+++ b/pysite/settings.py
@@ -167,9 +167,12 @@ else:
# Django REST framework
# http://www.django-rest-framework.org
REST_FRAMEWORK = {
- 'DEFAULT_AUTHENTICATION_CLASSES': [
- 'rest_framework.authentication.TokenAuthentication'
- ],
+ 'DEFAULT_AUTHENTICATION_CLASSES': (
+ 'rest_framework.authentication.TokenAuthentication',
+ ),
+ 'DEFAULT_PERMISSION_CLASSES': (
+ 'rest_framework.permissions.DjangoModelPermissions',
+ ),
'TEST_REQUEST_DEFAULT_FORMAT': 'json'
}