分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

django接受json数据到html

发布时间:2023-09-06 01:55责任编辑:林大明关键词:jsjsondjango
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 }}

django接受json数据到html

原文地址:http://blog.51cto.com/13675040/2118641

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved