1 from django.shortcuts import render
2 from django.http import HttpResponse, HttpRequest
9 from django.views.decorators.csrf import csrf_exempt
12 connection = sqlite3.connect("logs/Kismet-20221208-22-56-36-1.kismet")
13 #connection.row_factory = lambda cursor, row: row[0]
14 cursor = connection.cursor()
15 rows = cursor.execute(query).fetchall()
19 def index(request,devicename):
20 dev=list(load_db("select cast(device as text) from devices where devkey = \""+devicename+"\""))
22 #dev_string = "{ \"recordsTotal\": "+str(dev_count)+", \"data\": ["
23 #dev_list = list(load_db("select cast(device as text) from devices limit 50"))
24 #for device in dev_list:
26 # dev_string = dev_string + dev + ","
27 #dev_string = dev_string[:-1]
28 #dev_string = dev_string + "],\"draw\": 5,\"recordsFiltered\": "+str(dev_count)+"}"
29 return HttpResponse(dev_info, content_type='text/json')