From c29e8fbef83ccb6a8a2bfac918fbee5ce0e6259c Mon Sep 17 00:00:00 2001 From: Robert Einsle Date: Mon, 9 Jan 2017 19:00:03 +0100 Subject: [PATCH] add authentication classes --- caromserver/settings.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/caromserver/settings.py b/caromserver/settings.py index 3f17a25..13a404b 100644 --- a/caromserver/settings.py +++ b/caromserver/settings.py @@ -15,7 +15,6 @@ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ @@ -27,7 +26,6 @@ DEBUG = True ALLOWED_HOSTS = ['*'] - # Application definition INSTALLED_APPS = [ @@ -72,7 +70,6 @@ TEMPLATES = [ WSGI_APPLICATION = 'caromserver.wsgi.application' - # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases @@ -116,7 +113,6 @@ USE_L10N = True USE_TZ = True - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ @@ -127,7 +123,12 @@ REST_FRAMEWORK = { # or allow read-only access for unauthenticated users. 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' - ] + ], + 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework.authentication.BasicAuthentication', + 'rest_framework.authentication.SessionAuthentication', + 'rest_framework.authentication.TokenAuthentication', + ), } STATIC_ROOT = "/srv/carom/carom-server/static/" @@ -141,4 +142,3 @@ try: from caromserver.local_settings import * except ImportError: pass -