最新黑马python培训班学费黑马python培训周期多久培训时间
下载地址 https://share.weiyun.com/dHvWwF1o
资料目录 黑马程序员python入门教程19天(美女讲师版) 包含:视频课程-python从0开始学编程(day1-day19) 课件+代码资料-python从0开始学编程(day1-day19) 黑马python基础班代码和课件资料 黑马python就业班代码和课件资料 黑马python基础班视频课程 包含:1-1 Linux基础(119个视频) 1-2 python基础(234个视频) 1-3 面向对象(91个视频) 1-4 项目飞机大战(42个视频) 黑马python就业班视频课程 包含:01 网络编程 02 多任务 03 web服务器v3.1 04 Python高级语法v3.1 05 MySQL数据库v3.1 06 mini-web框架v3.1 07 HTML和CSS 08 首页布局案例和移动布局 09 JavaScriptv 10 jQuery和js库 11 Django框架 12 git版本管理 13 redis数据库 14 天天生鲜Django项目 15 flask框架 16 微信公众号 17 爱家租房项目 18 通用爬虫模块使用 19 MongoDB数据库 20 爬虫scrapy框架及案例 21 数据分析 22 机器学习 23 深度学习 24 数据结构和算法 25 Python网络爬虫 26 机器学习入门篇 27 机器学习入门篇2 28 机器学习提升篇 29 数据挖掘篇 30 深度学习必备原理与实战 31 深度学习必备原理与实战2 32 深度学习必备原理与实战3 33 深度学习必备原理与实战4 34 深度学习项目实战 35 深度学习项目实战2 36 深度学习项目实战3 举例 修改项目 hostinfo 下的 views.py 代码如下: # Create your views here. #包含以下模块 from django.shortcuts import render_to_response from django.http import HttpResponse from models import Host, HostGroup #包含json模块 try: import json except ImportError,e: import simplejson as json #用来接收客户端服务器发送过来的数据 def collect(request): req = request if req.POST: vendor = req.POST.get('Product_Name') sn = req.POST.get('Serial_Number') product = req.POST.get('Manufacturer') cpu_model = req.POST.get('Model_Name') cpu_num = req.POST.get('Cpu_Cores') cpu_vendor = req.POST.get('Vendor_Id') memory_part_number = req.POST.get('Part_Number') memory_manufacturer = req.POST.get('Manufacturer') memory_size = req.POST.get('Size') device_model = req.POST.get('Device_Model') device_version = req.POST.get('Firmware_Version') device_sn = req.POST.get('Serial_Number') device_size = req.POST.get('User_Capacity') osver = req.POST.get('os_version') hostname = req.POST.get('os_name') os_release = req.POST.get('os_release') ipaddrs = req.POST.get('Ipaddr') mac = req.POST.get('Device') link = req.POST.get('Link') mask = req.POST.get('Mask') device = req.POST.get('Device') host = Host() host.hostname = hostname host.product = product host.cpu_num = cpu_num host.cpu_model = cpu_model host.cpu_vendor = cpu_vendor host.memory_part_number = memory_part_number host.memory_manufacturer = memory_manufacturer host.memory_size = memory_size host.device_model = device_model host.device_version = device_version host.device_sn = device_sn host.device_size = device_size host.osver = osver host.os_release = os_release host.vendor = vendor host.sn = sn host.ipaddr = ipaddrs host.save() #将客户端传过来的数据通过POST接收,存入数据库 return HttpResponse('OK') #如果插入成功,返回'ok' else: return HttpResponse('no post data') #提供给NAGIOS 的API def gethosts(req): d = [] hostgroups = HostGroup.objects.all() for hg in hostgroups: ret_hg = {'hostgroup':hg.name,'members':[]} members = hg.members.all() for h in members: ret_h = {'hostname':h.hostname, #API接口返回的数据 'ipaddr':h.ipaddr } ret_hg['members'].append(ret_h) d.append(ret_hg) ret = {'status':0,'data':d,'message':'ok'} return HttpResponse(json.dumps(ret))
|