diff --git a/breccia_mapper/settings.py b/breccia_mapper/settings.py index 5706267..a8c06c4 100644 --- a/breccia_mapper/settings.py +++ b/breccia_mapper/settings.py @@ -134,6 +134,16 @@ DBBACKUP_STORAGE_OPTIONS = { } +# Django REST Framework +# https://www.django-rest-framework.org/ + +REST_FRAMEWORK = { + 'DEFAULT_PERMISSION_CLASSES': [ + 'rest_framework.permissions.IsAuthenticated', + ], +} + + # Password validation # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators diff --git a/people/views.py b/people/views.py index 1484a77..40bdc51 100644 --- a/people/views.py +++ b/people/views.py @@ -2,6 +2,7 @@ Views for displaying or manipulating models in the 'people' app. """ +from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponseRedirect from django.urls import reverse from django.views.generic import CreateView, DetailView, ListView, TemplateView, UpdateView @@ -206,7 +207,7 @@ class RelationshipApiView(APIView): return Response(serializer.data) -class NetworkView(TemplateView): +class NetworkView(LoginRequiredMixin, TemplateView): """ View to display relationship network. """