Trying to get Django app to update variables that are taken from an external python script -


i've been working raspberry pi, , i've hooked temperature/humidity sensor , have python script reads values , logs them , time. i'm constructing django app, , goal have display webpage show current values taken in sensor in real time.

as of now, views.py taking in latest values log , passing html template when it's rendered so:

    return render(request, 'control_panel.html',{'humidity': relativeh, 'tempc': temperaturec, 'tempf': temperaturef, 'date': full_date}) 

those variables referenced in control_panel.html. right now, webpage loads properly, displaying values when page loaded. however, i'm not sure how keep updating variables on page it's date. insight appreciated.


Comments