create a view to display the charts

This commit is contained in:
Andreas Zweili 2019-10-20 21:39:03 +02:00
parent 93dfcf95d5
commit b6ad61ccce
1 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,13 @@
from django.shortcuts import render
from . import plot
from . import collector
# Create your views here.
def index_view(request):
collector.values_to_db()
plot_temp = plot.temperature()
plot_humidity = plot.humidity()
plot_pressure = plot.pressure()
return render(request, "collector/index.html",
context={'plot_temp': plot_temp,
'plot_humidity': plot_humidity,
'plot_pressure': plot_pressure})