Вот собственно views.py:
from django.shortcuts import render
import datetime
# Create your views here.
# Мои настройки по температуре
#####################################
from django.core.files import File
f = open('/tmp/temperature/temperature.txt', 'r')
my_temper_garaj = f.read()
f.close()
#####################################
def my_list(request):
now = datetime.datetime.now()
my_time_new = now.strftime("%H:%M")
my_date_new = now.strftime("%d-%m-%Y")
#my_temper_garaj = 10 #старое статическое значение температуры
my_temper_ulica = 11
my_temper_dom = 12
return render(request, 'main/index.html', context={'my_time': my_time_new, 'my_date': my_date_new, 'temper_garaj': my_temper_garaj, 'temper_ulica': my_temper_ulica, 'temper_dom': my_temper_dom})
вот кусок index.html
<p>
<ul class="list-group">
<li class="list-group-item">
<span class="badge">{{ temper_garaj }}</span>
Гараж
</li>
</ul>
</p>