• django 添加事务监控


    添加Mysql事务监控
    
    node2:/django/mysite/news/templates#vim main.html 
    
                    </div>
            </div>
            <div class="content">
                    <feff><div class="nav fl">
                            <div class="search">
                                    <input type="text" placeholder="Search" name="searchcon">
                                    <span class="search_btn"></span>
                            </div>
                            <div class="menu">
                                    <dl>
                                        <dt><i class="icon-menu i_1 fl"></i>在线监控平台<i class="icon-menu i_6 fr"></i></dt>
                                        <dd><a href="/addMachine">监控设备添加</a></dd>
                                        <dd><a href="/transactionIndex">Mysql 事务监控</a></dd>
    
    
    node2:/django/mysite/mysite#cat urls.py
    """mysite URL Configuration
    
    The `urlpatterns` list routes URLs to views. For more information please see:
        https://docs.djangoproject.com/en/1.11/topics/http/urls/
    Examples:
    Function views
        1. Add an import:  from my_app import views
        2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
    Class-based views
        1. Add an import:  from other_app.views import Home
        2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
    Including another URLconf
        1. Import the include() function: from django.conf.urls import url, include
        2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
    """
    from django.conf.urls import include,url
    from django.contrib import admin
    from blog import views as view
    from news import views as newview
    urlpatterns =( 
    url(r'^admin/', admin.site.urls),
    url(r'^blog/$',view.archive),
    url(r'^articles/',include("news.urls")),
    url(r'^upload/$',newview.upload,name='upload'),
    url(r'^main/$', newview.main),
    url(r'^$', newview.index),
    url(r'^get_name/$', newview.get_name),
    url(r'^index/$', newview.index),
    url(r'^test_func/$', newview.test_func),
    url(r'^addMachine/$', newview.addMachine),
    url(r'^transactionIndex/$', newview.transactionIndex),
    url(r'^api/getTemp/$', newview.getTemp),
    url(r'^api/listjson/$', newview.list_json),
    url(r'^api/getGroup/$', newview.getGroup),
    url(r'^api/addMonitor/$', newview.addMonitor),
    )
    
    
    node2:/django/mysite/mysite#cat ../news/views.py
    # -*- coding: utf-8 -*-
    from __future__ import unicode_literals
    from django.shortcuts import render
    
    def addMachine(req):
             return render_to_response('addMachine.html')
    def transactionIndex(req):
             return render_to_response('transactionIndex.html')

  • 相关阅读:
    new function
    Confluence5.1 最新版的安装&破解&汉化
    ganglia 启动命令
    ganglia Web前端清除当机节点
    git初始化
    递归算法的时间复杂度分析
    tcp dump 截取http
    java.io.Serializable浅析
    java 复用类的三种方式区别 组合,继承,代理的区别
    Linux netstat命令详解
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349369.html
Copyright © 2020-2023  润新知