diff --git a/atdb/atdb/settings/base.py b/atdb/atdb/settings/base.py index c8fe98fd707693532465a4dc3a5c21bd70a99cd2..79d03f49dd38ad97a54c444e99d91a0098e04ea4 100644 --- a/atdb/atdb/settings/base.py +++ b/atdb/atdb/settings/base.py @@ -74,6 +74,7 @@ REST_FRAMEWORK = { 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' ], 'DEFAULT_AUTHENTICATION_CLASSES': [ + 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.TokenAuthentication', ], 'DEFAULT_FILTER_BACKENDS': ( diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index b46b483c6bda941312526d309520e74cb97d58f9..096baa9294dcdeca33762e90bf41de489a39495a 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -34,7 +34,7 @@ {% include 'taskdatabase/pagination.html' %} </div> </div> - <p class="footer"> Version 1.0.0 (4 mar 2021 - 15:00) + <p class="footer"> Version 1.0.0 (8 mar 2021 - 17:00) </div> diff --git a/atdb/taskdatabase/urls.py b/atdb/taskdatabase/urls.py index 744fa7e2d29dffe8bf3d935ada373a356e5c46cc..622bf459fedf36af6799beaa441c93d340fcdebd 100644 --- a/atdb/taskdatabase/urls.py +++ b/atdb/taskdatabase/urls.py @@ -1,5 +1,6 @@ from django.urls import include, path from django.contrib.auth import views as auth_views +from rest_framework.authtoken import views as rest_auth_views from . import views @@ -36,6 +37,9 @@ urlpatterns = [ path('config/', views.ShowConfig, name='config'), # --- REST API --- + + path('obtain-auth-token/', rest_auth_views.obtain_auth_token), + path('tasks/', views.TaskListViewAPI.as_view(), name='tasks-api'), path('tasks/<int:pk>/', views.TaskDetailsViewAPI.as_view(), name='task-detail-view-api'), path('tasks-fast/', views.TaskListViewAPIFast.as_view(), name='tasks-api-fast'),