zoukankan      html  css  js  c++  java
  • django 页面调用方法

     <dl>
                                        <dt><i class="icon-menu i_4 fl"></i>设备管理系统<i class="icon-menu i_6 fr"></i></dt>
                                        <dd><a href="/cmdb/index">查看设备</a></dd>
                                            <dd><a href="/cmdb/rangeIndex">IP范围查询</a></dd>
                                        <dd><a href="/cmdb/addIndex">添加设备</a></dd>
    
    
    
    url(r'^cmdb/addIndex/$', newview.addIndex),
    
    url(r'^cmdb/addEquipment/$', newview.addEquipment),
    
    
    
    调用方法:
    def addIndex(req):
       return render_to_response('cmdb/addIndex.html')
    
    node2:/django/mysite/news/templates/cmdb#cat addIndex.html 
    <html>
    <head>
    	<title>运维平台</title>
    	<link rel="stylesheet" type="text/css" href="/static/Css/Equipment/addIndex.css">
    	<link rel="stylesheet" type="text/css" href="/static/Css/Public/header.css">
    	<link rel="stylesheet" type="text/css" href="/static/Css/Public/menu.css">
    </head>
    <body>
    	<include file="Public:header"/>
    	<div class="content">
    		<include file="Public:menu"/>
    		<div class="con fl">
    			<form id="condition" action="/cmdb/addEquipment/" method="post">
    				
    				<label class="condition">地址</label><input type="text" name="ip" class="equipment_sz">
    				<label class="condition">描述</label><input type="text" name="info" class="equipment_sz">
    				<label class="condition">环境</label><input type="text" name="env" class="equipment_sz">
    				<input type="submit" value="设备添加" class="equipment_add_btn">
    			</form>
    		</div>
    	</div>
    </body>
    <script type="text/javascript" src="/static/Js/jquery-2.2.2.min.js"></script>
    <!-- <script type="text/javascript" src="/static/Js/Equipment/addEquipment.js"></script> -->
    </html>
    
    
    
    
    调用/cmdb/addEquipment/
    
    
    def addEquipment(req):
        print  req.get_full_path()
        print req.POST['ip']
        print req.POST['info']
        print req.POST['env']
        return HttpResponse('abc123')
    
    
    /cmdb/addEquipment/
    wqeqw
    22qeqe
    rewr
    [24/Dec/2017 12:57:23] "POST /cmdb/addEquipment/ HTTP/1.1" 200 6
    Not Found: /favicon.ico
    [24/Dec/2017 13:02:26] "GET /favicon.ico HTTP/1.1" 404 5532

  • 相关阅读:
    实验4:开源控制器实践——OpenDaylight
    实验3:OpenFlow协议分析实践
    实验2:Open vSwitch虚拟交换机实践
    第一次个人编程作业
    SDN实验1:SDN拓扑实践
    第一次博客作业
    LeetCode-1290.Convert Binary Number in a Linked List to Integer
    面试题 02.02. Kth Node From End of List LCCI
    剑指 Offer 24. 反转链表
    剑指 Offer 06. 从尾到头打印链表
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349350.html
Copyright © 2011-2022 走看看