django接受json數據到html

views

    cursor = connection.cursor()
    cursor.execute("select staff_name  from  alarm_platform.TBL_STAFF where staff_number=(select duty_staff_number1   from alarm_platform.TBL_DUTY a  where duty_staff_time_start  >  DATE_SUB(CURDATE(), INTERVAL 0 DAY));")
    alert_today = cursor.fetchone()
    context_bak = {'msg': alert_list}
    print(context_bak)
    return  render(request,"mysql_insert.html", {'msg_1': json.dumps(context_bak)})

html接受數據

{{ msg_1 }}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章