[Patchew-devel] [PATCH 2/3] rest: enable token-based authentication

Paolo Bonzini posted 3 patches 75 weeks ago

[Patchew-devel] [PATCH 2/3] rest: enable token-based authentication

Posted by Paolo Bonzini 75 weeks ago
---
 patchew/settings.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/patchew/settings.py b/patchew/settings.py
index 11a79b4..dead744 100644
--- a/patchew/settings.py
+++ b/patchew/settings.py
@@ -47,6 +47,7 @@ INSTALLED_APPS = [
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'rest_framework',
+    'rest_framework.authtoken',
 ]
 
 MIDDLEWARE = [
@@ -62,6 +63,10 @@ MIDDLEWARE = [
 ]
 
 REST_FRAMEWORK = {
+    'DEFAULT_AUTHENTICATION_CLASSES': (
+        'rest_framework.authentication.TokenAuthentication',
+        'rest_framework.authentication.SessionAuthentication',
+    ),
     'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
     'URL_FIELD_NAME': 'resource_uri',
     'PAGE_SIZE': 50,
-- 
2.21.0


_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel