fix instance detail view in API
This commit is contained in:
parent
303d762854
commit
97a6d1321b
|
@ -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()
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue