diff --git a/apps/api/urls.py b/apps/api/urls.py index cb1dfaf3..6fe3e99f 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -46,6 +46,8 @@ register_activity_urls(router, 'activity') # Routers for note app register_note_urls(router, 'note') +app_name = 'api' + # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ diff --git a/apps/member/views.py b/apps/member/views.py index 8fa071c1..19b04992 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -142,7 +142,7 @@ class UserListView(LoginRequiredMixin,SingleTableView): class GenerateAuthTokenView(LoginRequiredMixin, TemplateView): """ - Génère un jeton d'authentification pour un utilisateur + Génère un jeton d'authentification pour un utilisateur et détruit l'ancien """ template_name = "member/generate_auth_token.html" diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index 8277e71c..9a526863 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -61,6 +61,7 @@ INSTALLED_APPS = [ 'activity', 'member', 'note', + 'api', ] LOGIN_REDIRECT_URL = '/note/transfer/' @@ -127,6 +128,7 @@ REST_FRAMEWORK = { # Use Django's standard `django.contrib.auth` permissions, # or allow read-only access for unauthenticated users. 'DEFAULT_PERMISSION_CLASSES': [ + # TODO Maybe replace it with our custom permissions system 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly' ], 'DEFAULT_AUTHENTICATION_CLASSES': [ diff --git a/templates/member/generate_auth_token.html b/templates/member/generate_auth_token.html index 6c64d972..22ff55fc 100644 --- a/templates/member/generate_auth_token.html +++ b/templates/member/generate_auth_token.html @@ -3,4 +3,20 @@ {% block content %} Jeton : {{ token }} + +
Authorization: Token <TOKEN>
+ pour pouvoir vous identifier.
+
+ Une documentation de l'API arrivera ultérieurement.
+