diff options
author | 2018-08-15 21:26:32 +0200 | |
---|---|---|
committer | 2018-08-15 21:26:32 +0200 | |
commit | eeeb3acb867fc47170051b3effbe8a9b43f3ab2e (patch) | |
tree | 70880fc2a28274293cc2e2f1efcfc075270cfa6a /pysite/settings.py | |
parent | Use `TokenAuthentication` instead of API keys. (diff) |
Require authentication to use the API.
Diffstat (limited to 'pysite/settings.py')
-rw-r--r-- | pysite/settings.py | 9 |
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' } |