Added Auth to Django REST API

This commit is contained in:
Sam Collins 2017-02-25 22:04:43 +00:00 committed by Oliver Marks
parent 7453c056ae
commit 9e0ada5f3d
1 changed files with 8 additions and 0 deletions

View File

@ -309,6 +309,14 @@ REST_FRAMEWORK = {
'django_filters.rest_framework.DjangoFilterBackend', 'django_filters.rest_framework.DjangoFilterBackend',
'rest_framework.filters.OrderingFilter' 'rest_framework.filters.OrderingFilter'
), ),
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
),
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
'PAGE_SIZE': 50 'PAGE_SIZE': 50
} }