1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| from django.shortcuts import render
|
| from django.http.response import HttpResponse
| # Create your views here.
|
| from math import pi, sin
|
| def index(request):
|
| sinpi2=sin(pi/2)
| intlist=list(range(1,11))
|
| moj_template='sensorui/index.html'
|
| data_table=[]
|
| data_table.append({'sensor_id':1,
| 'data': 10.0,
| 'date': '10.10.1010'
| })
|
| data_table.append({'sensor_id':1,
| 'data': 8.0,
| 'date': '11.10.1010'
| })
|
| data_table.append({'sensor_id':1,
| 'data': 12.0,
| 'date': '11.11.1010'
| })
| context={
| 'sinpi2':sinpi2,
| 'moje_ime': "Samo Penic",
| 'intlist': intlist,
| 'data_table': data_table,
| }
| return render(request, moj_template, context)
|
|