diff --git a/apiv1/views.py b/apiv1/views.py index 99eed00..77ec477 100644 --- a/apiv1/views.py +++ b/apiv1/views.py @@ -6,6 +6,7 @@ from apiv1.serializers import InstanceListSerializer, InstanceDetailSerializer class InstanceViewSet(viewsets.ModelViewSet): """API endpoint to view instances""" + lookup_field = 'name' lookup_value_regex = '[a-zA-Z0-9-_\.]+' queryset = Instance.objects.all() diff --git a/backend/settings/base.py b/backend/settings/base.py index fb0ec3c..5ccc15f 100644 --- a/backend/settings/base.py +++ b/backend/settings/base.py @@ -59,7 +59,6 @@ INSTALLED_APPS = [ ] MIDDLEWARE = [ - 'silk.middleware.SilkyMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -67,6 +66,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'silk.middleware.SilkyMiddleware', ] ROOT_URLCONF = 'backend.urls'