添加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')