django 控制页面跳转的例子
更新时间:2019年08月06日 10:53:40 作者:zhaoyangjian724
今天小编就为大家分享一篇django 控制页面跳转的例子,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
如下所示:
def delEquipment(request, delip): print delip ip=delip conn= MySQLdb.connect( host='localhost', port = 3306, user='root', passwd='1234567', db ='DEVOPS' ) cursor = conn.cursor() #a = cur.execute("select ip,info,env from machine_info where env=%s ",[group]) try : cursor.execute("delete from machine_info where ip=%s",[ip]) conn.commit() return redirect('/cmdb/modifyIndex') except : conn.rollback() return HttpResponse('del failed')
django 页面跳转:
return redirect('/cmdb/modifyIndex') url(r'^cmdb/modifyIndex/$', newview.modifyIndex), def modifyIndex(req): return render_to_response('cmdb/modifyIndex.html')
以上这篇django 控制页面跳转的例子就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
关于Python 解决Python3.9 pandas.read_excel(‘xxx.xlsx‘)报错的问题
这篇文章主要介绍了关于Python 解决Python3.9 pandas.read_excel(‘xxx.xlsx‘)报错的问题,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2020-11-11在ubuntu16.04中将python3设置为默认的命令写法
这篇文章主要介绍了在ubuntu16.04中将python3设置为默认python的方法,非常不错,具有一定的参考借鉴价值,需要的朋友参考下吧2018-10-10opencv中cv2.minAreaRect函数输出角度问题详解
minAreaRect返回的数据包括了矩形的中心点,宽、高,和旋转角度,下面这篇文章主要给大家介绍了关于opencv中cv2.minAreaRect函数输出角度问题的相关资料,需要的朋友可以参考下2022-11-11
最新评论