File tree 3 files changed +11
-0
lines changed
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 39
39
'django.contrib.staticfiles' ,
40
40
41
41
'rest_framework' ,
42
+ 'corsheaders' ,
42
43
]
43
44
44
45
MIDDLEWARE = [
46
+ 'corsheaders.middleware.CorsMiddleware' ,
45
47
'django.middleware.security.SecurityMiddleware' ,
46
48
'django.contrib.sessions.middleware.SessionMiddleware' ,
47
49
'django.middleware.common.CommonMiddleware' ,
71
73
72
74
WSGI_APPLICATION = 'api.wsgi.application'
73
75
76
+ # Cross-Origin
77
+
78
+ CORS_ORIGIN_ALLOW_ALL = True
74
79
75
80
# Database
76
81
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
Original file line number Diff line number Diff line change 16
16
from django .contrib import admin
17
17
from django .urls import include , path
18
18
19
+ from rest_framework import routers
20
+
19
21
from cli import views
20
22
23
+ router = routers .DefaultRouter ()
24
+
21
25
urlpatterns = [
26
+ path ('' , include (router .urls )),
22
27
path ('cli/' , views .CliView .as_view ()),
23
28
path ('data/' , views .DataView .as_view ()),
24
29
]
Original file line number Diff line number Diff line change 6
6
7
7
from helper import *
8
8
import json
9
+ from django .http import HttpResponse , JsonResponse
9
10
10
11
class CliView (APIView ):
11
12
"""Pass in command directly to sherlock."""
You can’t perform that action at this time.
0 commit comments