add SessionAuthentication
authorHongyuan Ma <CS_MaleicAcid@163.com>
Mon, 2 Jul 2018 15:59:22 +0000 (23:59 +0800)
committerHongyuan Ma <CS_MaleicAcid@163.com>
Mon, 2 Jul 2018 15:59:22 +0000 (23:59 +0800)
web/pgperffarm/settings.py

index c6210ff231cab6d4300ad73e0f8ac267bd3a1e74..fdb650dd46d3b894750f47fe769c02efd2ff7b5d 100644 (file)
@@ -136,6 +136,11 @@ REST_FRAMEWORK = {
     #     'rest_framework.authentication.SessionAuthentication',
     # ),
     # 'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',),
+
+    'DEFAULT_AUTHENTICATION_CLASSES': (
+        'rest_framework.authentication.BasicAuthentication',
+        'rest_framework.authentication.SessionAuthentication',
+    ),
     'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
     'PAGE_SIZE': 20
 }