fix instance detail view in API

pull/1/head
Tao Bojlen 2018-08-27 12:43:16 +02:00
rodzic 303d762854
commit 97a6d1321b
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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()

Wyświetl plik

@ -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'