diff options
author | 2018-08-15 20:12:04 +0200 | |
---|---|---|
committer | 2018-08-15 20:12:04 +0200 | |
commit | b3102c706c25ce23ef2e3c49b45f28ed54e8aef3 (patch) | |
tree | 6e12aa753ecdc1118c40f041c7d944f028ec9e90 /pysite/settings.py | |
parent | Add the `SnakeName` model. (diff) |
Use `TokenAuthentication` instead of API keys.
Diffstat (limited to 'pysite/settings.py')
-rw-r--r-- | pysite/settings.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pysite/settings.py b/pysite/settings.py index b727c246..914fcbe5 100644 --- a/pysite/settings.py +++ b/pysite/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.1/ref/settings/ """ import os +import sys import environ @@ -64,6 +65,8 @@ INSTALLED_APPS = [ 'django.contrib.staticfiles', 'django_hosts', + 'rest_framework', + 'rest_framework.authtoken' ] MIDDLEWARE = [ @@ -164,9 +167,10 @@ else: # Django REST framework # http://www.django-rest-framework.org REST_FRAMEWORK = { - 'DEFAULT_PERMISSION_CLASSES': [ - 'pysite.permissions.HasValidAPIKey' - ] + 'DEFAULT_AUTHENTICATION_CLASSES': [ + 'rest_framework.authentication.TokenAuthentication' + ], + 'TEST_REQUEST_DEFAULT_FORMAT': 'json' } # Bot API settings |