def handle(self, *args, **options): print("Refreshing Happy data...") Happy.update_data()
def index(request): env = Environment(loader=PackageLoader('cityscape', 'templates')) template = env.get_template('jinja2/index.html') return HttpResponse(template.render(influx_calc = Influx.score_calc(),influx =Influx.score(), traffic = Traffic.comparison(), weather = ''.join((Weather.current_weather(), ".png")), image = Happy.chart()["image"]))
def chart(request): return JsonResponse(Happy.chart(), safe=False)