Commit b1fa0280 authored by Brandon Dunn's avatar Brandon Dunn
Browse files

fixed issues

parent 7f294208
# Generated by Django 2.2.1 on 2019-05-11 17:27 # Generated by Django 2.2.4 on 2019-09-04 16:24
from django.conf import settings from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
......
...@@ -8,31 +8,31 @@ request = HttpResponse() ...@@ -8,31 +8,31 @@ request = HttpResponse()
# Create your views here. # Create your views here.
class HostViewset(viewsets.ModelViewSet): class HostViewset(viewsets.ModelViewSet):
queryset = models.Host.objects.all() queryset = models.Host.objects.all()
serializer_class = serializers.IPSerializer serializer_class = serializers.HostSerializer
class RecordViewset(viewsets.ModelViewSet): class RecordViewset(viewsets.ModelViewSet):
queryset = models.Record.objects.all() queryset = models.Record.objects.all()
serializer_class = serializers.IPSerializer serializer_class = serializers.RecordSerializer
class AdapterViewset(viewsets.ModelViewSet): class AdapterViewset(viewsets.ModelViewSet):
queryset = models.Adapter.objects.all() queryset = models.Adapter.objects.all()
serializer_class = serializers.IPSerializer serializer_class = serializers.AdapterSerializer
class MacViewset(viewsets.ModelViewSet): class MacViewset(viewsets.ModelViewSet):
queryset = models.Mac.objects.all() queryset = models.Mac.objects.all()
serializer_class = serializers.IPSerializer serializer_class = serializers.MacSerializer
class RoleViewset(viewsets.ModelViewSet): class RoleViewset(viewsets.ModelViewSet):
queryset = models.Role.objects.all() queryset = models.Role.objects.all()
serializer_class = serializers.IPSerializer serializer_class = serializers.RoleSerializer
class PreambleViewset(viewsets.ModelViewSet): class PreambleViewset(viewsets.ModelViewSet):
queryset = models.Preamble.objects.all() queryset = models.Preamble.objects.all()
serializer_class = serializers.IPSerializer serializer_class = serializers.PreambleSerializer
class SubnetViewset(viewsets.ModelViewSet): class SubnetViewset(viewsets.ModelViewSet):
queryset = models.Subnet.objects.all() queryset = models.Subnet.objects.all()
serializer_class = serializers.IPSerializer serializer_class = serializers.SubnetSerializer
class IPViewset(viewsets.ModelViewSet): class IPViewset(viewsets.ModelViewSet):
queryset = models.IP.objects.all() queryset = models.IP.objects.all()
......
...@@ -26,7 +26,9 @@ SECRET_KEY = 'ryje5w$tb+4i-c^%86r!**sqeyn&-^&s)3%y8w7683x^7260q-' ...@@ -26,7 +26,9 @@ SECRET_KEY = 'ryje5w$tb+4i-c^%86r!**sqeyn&-^&s)3%y8w7683x^7260q-'
DEBUG = True DEBUG = True
ALLOWED_HOSTS = ['localhost'] ALLOWED_HOSTS = ['localhost']
CORS_ORIGIN_ALLOW_ALL = True CORS_ORIGIN_WHITELIST = (
'https://localhost:3000',
)
# Application definition # Application definition
...@@ -44,6 +46,7 @@ INSTALLED_APPS = [ ...@@ -44,6 +46,7 @@ INSTALLED_APPS = [
] ]
MIDDLEWARE = [ MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment