def vote(code): json_editor('json_data_file', code) programme_list = json_reader('json_data_file') return render_template('index.html', programme_list=programme_list)
def leaders(): programme_list = json_reader('json_data_file') newlist = sorted(programme_list, key=itemgetter('stars'), reverse=True) return render_template('leaders.html', programme_list=newlist)
def index(): try: programme_list = json_reader('json_data_file') return render_template('index.html', programme_list=programme_list) except FileNotFoundError: return render_template('index.html', message="Please upload a file.")