From a2ad3a0b9cb8da5e96e8eca98773c4169bb4e1fd Mon Sep 17 00:00:00 2001 From: jiayanhua <402602239@qq.com> Date: Thu, 16 Nov 2017 08:22:43 +0800 Subject: [PATCH 01/11] conn --- content.txt | 764 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 764 insertions(+) create mode 100644 content.txt diff --git a/content.txt b/content.txt new file mode 100644 index 0000000..530365d --- /dev/null +++ b/content.txt @@ -0,0 +1,764 @@ +HTTP/1.1 200 OK +Date: Tue, 15 Aug 2017 16:43:22 GMT +Content-Type: text/html; charset=utf-8 +Transfer-Encoding: chunked +Connection: Keep-Alive +Vary: Accept-Encoding +Set-Cookie: BAIDUID=F754A1679CFBAFCBDA989B62FFBD44FE:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com +Set-Cookie: BIDUPSID=F754A1679CFBAFCBDA989B62FFBD44FE; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com +Set-Cookie: PSTM=1502815402; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com +Set-Cookie: BDSVRTM=0; path=/ +Set-Cookie: BD_HOME=0; path=/ +Set-Cookie: H_PS_PSSID=1465_21112_18559_17001_22159; path=/; domain=.baidu.com +P3P: CP=" OTI DSP COR IVA OUR IND COM " +Cache-Control: private +Cxy_all: baidu+2f66ed89946988f9adee45606209d721 +Expires: Tue, 15 Aug 2017 16:42:37 GMT +X-Powered-By: HPHP +Server: BWS/1.1 +X-UA-Compatible: IE=Edge,chrome=1 +BDPAGETYPE: 1 +BDQID: 0xe6587ab60004727d +BDUSERID: 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 百度一下,你就知道 + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9a4912a67287e545381a992460e31bdcf2571a2d Mon Sep 17 00:00:00 2001 From: jiayanhua <402602239@qq.com> Date: Thu, 16 Nov 2017 08:24:17 +0800 Subject: [PATCH 02/11] commit test --- ansible/playbook1.yml | 45 +++ autodev.py | 63 ++++ ben-11.py | 41 +++ check_port.py | 3 + checkdns.py | 50 +++ copy.pyc | Bin 0 -> 1169 bytes debug.py | 60 ++++ django_08day11/.idea/django_08day11.iml | 11 + django_08day11/.idea/misc.xml | 4 + django_08day11/.idea/modules.xml | 8 + django_08day11/.idea/workspace.xml | 333 +++++++++++++++++++ django_08day11/adminx/__init__.py | 0 django_08day11/adminx/__init__.pyc | Bin 0 -> 130 bytes django_08day11/adminx/admin.py | 6 + django_08day11/adminx/apps.py | 8 + django_08day11/adminx/migrations/__init__.py | 0 django_08day11/adminx/models.py | 6 + django_08day11/adminx/tests.py | 6 + django_08day11/adminx/urls.py | 31 ++ django_08day11/adminx/urls.pyc | Bin 0 -> 1281 bytes django_08day11/adminx/views.py | 6 + django_08day11/db.sqlite3 | Bin 0 -> 3072 bytes django_08day11/django_08day11/__init__.py | 0 django_08day11/django_08day11/__init__.pyc | Bin 0 -> 139 bytes django_08day11/django_08day11/settings.py | 120 +++++++ django_08day11/django_08day11/settings.pyc | Bin 0 -> 2591 bytes django_08day11/django_08day11/urls.py | 31 ++ django_08day11/django_08day11/urls.pyc | Bin 0 -> 1215 bytes django_08day11/django_08day11/wsgi.py | 16 + django_08day11/django_08day11/wsgi.pyc | Bin 0 -> 611 bytes django_08day11/manage.py | 22 ++ django_08day11/web/__init__.py | 1 + django_08day11/web/__init__.pyc | Bin 0 -> 128 bytes django_08day11/web/admin.py | 6 + django_08day11/web/apps.py | 8 + django_08day11/web/migrations/__init__.py | 0 django_08day11/web/models.py | 6 + django_08day11/web/tests.py | 6 + django_08day11/web/urls.py | 31 ++ django_08day11/web/urls.pyc | Bin 0 -> 1238 bytes django_08day11/web/views.py | 18 + django_08day11/web/views.pyc | Bin 0 -> 960 bytes djangotest/Model/__init__.py | 7 + djangotest/Template/Account/login.html | 11 + djangotest/Template/__init__.py | 7 + djangotest/View/Account.py | 23 ++ djangotest/View/Account.pyc | Bin 0 -> 576 bytes djangotest/View/Admin.py | 10 + djangotest/View/Admin.pyc | Bin 0 -> 266 bytes djangotest/View/__init__.py | 7 + djangotest/View/__init__.pyc | Bin 0 -> 131 bytes djangotest/config.py | 17 + djangotest/index.py | 52 +++ djangotest/testsocket.py | 29 ++ list_vm.py | 98 ++++++ psutil.py | 0 recive.py | 28 ++ sbx.xls | Bin 0 -> 4915 bytes send.py | 21 ++ site_count.py | 81 +++++ testbook.xlsx | Bin 0 -> 6225 bytes weburlcheck.py | 67 ++++ xls.py | 25 ++ xls.xlsx | Bin 0 -> 5389 bytes xxx.xlsx | Bin 0 -> 4916 bytes 65 files changed, 1429 insertions(+) create mode 100644 ansible/playbook1.yml create mode 100644 autodev.py create mode 100644 ben-11.py create mode 100644 check_port.py create mode 100644 checkdns.py create mode 100644 copy.pyc create mode 100644 debug.py create mode 100644 django_08day11/.idea/django_08day11.iml create mode 100644 django_08day11/.idea/misc.xml create mode 100644 django_08day11/.idea/modules.xml create mode 100644 django_08day11/.idea/workspace.xml create mode 100644 django_08day11/adminx/__init__.py create mode 100644 django_08day11/adminx/__init__.pyc create mode 100644 django_08day11/adminx/admin.py create mode 100644 django_08day11/adminx/apps.py create mode 100644 django_08day11/adminx/migrations/__init__.py create mode 100644 django_08day11/adminx/models.py create mode 100644 django_08day11/adminx/tests.py create mode 100644 django_08day11/adminx/urls.py create mode 100644 django_08day11/adminx/urls.pyc create mode 100644 django_08day11/adminx/views.py create mode 100644 django_08day11/db.sqlite3 create mode 100644 django_08day11/django_08day11/__init__.py create mode 100644 django_08day11/django_08day11/__init__.pyc create mode 100644 django_08day11/django_08day11/settings.py create mode 100644 django_08day11/django_08day11/settings.pyc create mode 100644 django_08day11/django_08day11/urls.py create mode 100644 django_08day11/django_08day11/urls.pyc create mode 100644 django_08day11/django_08day11/wsgi.py create mode 100644 django_08day11/django_08day11/wsgi.pyc create mode 100644 django_08day11/manage.py create mode 100644 django_08day11/web/__init__.py create mode 100644 django_08day11/web/__init__.pyc create mode 100644 django_08day11/web/admin.py create mode 100644 django_08day11/web/apps.py create mode 100644 django_08day11/web/migrations/__init__.py create mode 100644 django_08day11/web/models.py create mode 100644 django_08day11/web/tests.py create mode 100644 django_08day11/web/urls.py create mode 100644 django_08day11/web/urls.pyc create mode 100644 django_08day11/web/views.py create mode 100644 django_08day11/web/views.pyc create mode 100644 djangotest/Model/__init__.py create mode 100644 djangotest/Template/Account/login.html create mode 100644 djangotest/Template/__init__.py create mode 100644 djangotest/View/Account.py create mode 100644 djangotest/View/Account.pyc create mode 100644 djangotest/View/Admin.py create mode 100644 djangotest/View/Admin.pyc create mode 100644 djangotest/View/__init__.py create mode 100644 djangotest/View/__init__.pyc create mode 100644 djangotest/config.py create mode 100644 djangotest/index.py create mode 100644 djangotest/testsocket.py create mode 100644 list_vm.py create mode 100644 psutil.py create mode 100644 recive.py create mode 100644 sbx.xls create mode 100644 send.py create mode 100644 site_count.py create mode 100644 testbook.xlsx create mode 100644 weburlcheck.py create mode 100644 xls.py create mode 100644 xls.xlsx create mode 100644 xxx.xlsx diff --git a/ansible/playbook1.yml b/ansible/playbook1.yml new file mode 100644 index 0000000..b81f2bb --- /dev/null +++ b/ansible/playbook1.yml @@ -0,0 +1,45 @@ +--- + +- hosts: all + user: root + vars_prompt: + - name: http #bianlinag mingc + prompt: please enter something: + private: no #display connect + task: + - name: test action + action: yum name=httpd state=installed #one acion + - name: configure apache + copy: src=files/httpd.conf dest=/etc/httpd/config/httpd.conf #two 模块名 + - name: restart apache + service: + name: httpd + state: restarted #three 格式写法 + tasks: + - name: install memcached + yum: name=memcached state=installed + - name: set memcached size ##设置变量,将内存的4分之1 + set_fact: memcached_size="{{ansible_memtotal_mb/4}}" + - name: templete configure files + templete: src=templete.j2 dest=/etc/foo.configure + notify:#通知必须有,不然handler不会执行 + - restart memcached #调用 + - restart apache + handlers: + - name: restart memcached + service: name=memcached state=restarted + - name: restart apache + service: name=httpd state=restarted + +- hosts: all + user: root + vars: + + task: + - name: stop memcached + service: name=memcached state=stopped + - name: remove memcached + command: rpm -e memcached --nodeps + handlers: + - name: restart memcached + service: name= diff --git a/autodev.py b/autodev.py new file mode 100644 index 0000000..6a3318a --- /dev/null +++ b/autodev.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/8/15 14:59 +# @Author : jiayanhua +# @Site : +# @File : autodev.py +# @Software: PyCharm Community Edition +#IPy +''' + +from IPy import IP +#以不同格式展示 +print(IP('192.168.0.0/24').strNormal(0)) +print(IP('192.168.0.0/24').strNormal(1)) +print(IP('192.168.0.0/24').strNormal(2)) +print(IP('192.168.0.0/24').strNormal(3)) +#多网格计算方法,ip段是否叠加 +print IP('10.0.0.0/24') 1: + print ('net:%s' %ips.net()) + print ('netmask:%s' %ips.netmask()) + print ('broadcast:%s' %ips.broadcast()) + print ('reverse address:%s' %ips.reverseNames()[0]) + +''' +#DNS +## A 记录 +import dns.resolver +domain = raw_input('please enter domain : ') +A = dns.resolver.query(domain,'A') #指定查A记录/NS/CNAME +for i in A.response.answer: + for j in i.items: + print j.address + + + + + + diff --git a/ben-11.py b/ben-11.py new file mode 100644 index 0000000..e673ccc --- /dev/null +++ b/ben-11.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# print "+++++++++++++11+++++++++++++++" +# print "How old are you?", +# age=raw_input() +# print "How tall are you ?", +# height=raw_input() +# print "How much are you weight?", +# weight=raw_input() +# +# print "So you's %r old,%r tall and %r heavy"%(age,height,weight) +# +# nId='' +# while 1: +# nId=raw_input("Input you id plz") +# if len(nId) != len("1223213123123******"): +# print 'wring length of id' +# else: +# break +# +# print 'you id is %s'%(nId) +# +# #int +# nAge=int(raw_input("input you age plz:\n")) +# if nAge > 0 and nAge < 120: +# print 'thanks!' +# else: +# print 'bad age' +# print 'you age is %d\n'%nAge +# +# #flat +# fweight=0.0 +# fweight=float(raw_input('input you weight\n')) +# print 'your weight is %f'%fweight + + +print "++++++++++++++++12++++++++++++++++++" +age=raw_input("how age you ?") +weight=raw_input("how are you weight") +height=raw_input("how are you height") +print "so you age %r,height %r ,weight %r"%(age,weight,height) \ No newline at end of file diff --git a/check_port.py b/check_port.py new file mode 100644 index 0000000..d995e42 --- /dev/null +++ b/check_port.py @@ -0,0 +1,3 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +#one diff --git a/checkdns.py b/checkdns.py new file mode 100644 index 0000000..72348f0 --- /dev/null +++ b/checkdns.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/8/15 19:43 +# @Author : jiayanhua +# @Site : +# @File : checkdns.py +# @Software: PyCharm Community Edition +#定义域名, +#解析域名获取ip,多个ip访问list中 +#对ip进行http检测 +import dns.resolver +import httplib +import os + +iplist = [] +appdomain = "www.qq.com" + +def get_doaminip(domain=""): + try: + ips=dns.resolver.query(domain,'A') + except Exception,e: + print " resolver is error:"+ str(e) + return + for i in ips.response.answer: + for j in i.items: + iplist.append(j.address) + return True +def checkip(ip): + checkurl = ip + ":80" + #print checkurl + getcontent = "" + httplib.socket.setdefaulttimeout(5) + conn = httplib.HTTPConnection(checkurl) + try: + conn.request("GET","/",headers={"Host":appdomain}) #发起url请求 + r = conn.getresponse() + getcontent = r.read(15) + #print getcontent + finally: + if getcontent == "": + print ip +"[ok]" + else: + print ip + "[error]" +if __name__ == "__main__": + #print iplist + if get_doaminip(appdomain) and len(iplist) > 0: + for ip in iplist: + checkip(ip) + else: + print "dns reslove is error" \ No newline at end of file diff --git a/copy.pyc b/copy.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f4f89985ff073c12f08cf953ec9a73ef6d5967a6 GIT binary patch literal 1169 zcmb7D&1(}u6o0du&rMQe5Q`#$;2{@-U({5J6r@!TEhP=8AyBrv({$4PNOoo=!SrJM zI4KAo#G?m~Meu{#s(*lgM+5fkAE56|YJ2kF?#`Rv`MKMjpE zFv^|*F9UuS8d=n{@EEtUfLq{NFvP8Lz;h721UCn_ZU>kmk299ETrOaF;x|5v;vvB$ z6pD&>I35Bi-nf8F!F6>yKdxA6fH^OxQRnqtKTr3jXwdZ)ZoA5VnQgw}bWAp6xnLq(cof*Fzn+x4pan_O(i*WjS7L zb4SS>V(F_+Wt>=?LS2#ZFw^C0WzzNW)uWi#=v-@bGCC10_Qa}oFE7-WG$k)=i9jE* zCxW=Q@?-z&RtWF3J=^biyy=9Ueg$ommx?-vvpkIgj1)6j ziJipPGD@t-&aeqqU>5sVSLyo7*x^!gSLd6@d}TUct)Iqn*G`}~BK)7MspJ_ybYqX-pfi+bQRI<1z9kd6 RTC8B?k$aJ4i+QwWj6Z^b`z` + + + + + + + + + \ No newline at end of file diff --git a/django_08day11/.idea/misc.xml b/django_08day11/.idea/misc.xml new file mode 100644 index 0000000..32b1140 --- /dev/null +++ b/django_08day11/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/django_08day11/.idea/modules.xml b/django_08day11/.idea/modules.xml new file mode 100644 index 0000000..79df6dc --- /dev/null +++ b/django_08day11/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/django_08day11/.idea/workspace.xml b/django_08day11/.idea/workspace.xml new file mode 100644 index 0000000..1f0f403 --- /dev/null +++ b/django_08day11/.idea/workspace.xml @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+

password:

+ + \ No newline at end of file diff --git a/djangotest/Template/__init__.py b/djangotest/Template/__init__.py new file mode 100644 index 0000000..75c2ae6 --- /dev/null +++ b/djangotest/Template/__init__.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/11/12 10:19 +# @Author : jiayanhua +# @Site : +# @File : __init__.py.py +# @Software: PyCharm Community Edition \ No newline at end of file diff --git a/djangotest/View/Account.py b/djangotest/View/Account.py new file mode 100644 index 0000000..2e9e55e --- /dev/null +++ b/djangotest/View/Account.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/11/12 10:28 +# @Author : jiayanhua +# @Site : +# @File : Account.py +# @Software: PyCharm Community Edition +# 处理账号相关的 +def login(): + #读取html文件 + #再与数据库中的账号密码进行比对,对数据库存、取用到model模块 + #返回给用户时用到view + f = file('E:\example\djangotest\Template\Account\login.html') + data = f.read() + return data + #return "login" + +def loginout(): + return "loginout" + +def changepasswd(): + return "changepassdd" + diff --git a/djangotest/View/Account.pyc b/djangotest/View/Account.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ef18a6a57e7ecb56777b97b4c86f288bed13068 GIT binary patch literal 576 zcmb_Z!3x4K49!->O%y-D>p<`WL_`^0ci3)Ym$8scmF`M#DSZX5nAfEF}B`&Izu78{&O)VbE2|3id%Z+hgTm!K$M7}!0Wd3=Ay{3{gM^BSWwT6Ho+2oij)s3rHPI+OLEa z$j!`4Nv+TTG8oW^Voji!t5r;DMPhD2PHId_R$^Xyeo1O^NsM!TUP)1YPEKl3jAKe} tW}aR_We~^&P9QD@+04M`rvY*tSd=1jOE`eW*yQG?l;)(`fz1aQ4*;CbGj9L@ literal 0 HcmV?d00001 diff --git a/djangotest/View/__init__.py b/djangotest/View/__init__.py new file mode 100644 index 0000000..93560ad --- /dev/null +++ b/djangotest/View/__init__.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/11/12 10:20 +# @Author : jiayanhua +# @Site : +# @File : __init__.py.py +# @Software: PyCharm Community Edition \ No newline at end of file diff --git a/djangotest/View/__init__.pyc b/djangotest/View/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..126dedbc80c670b753111e62322613565a642b63 GIT binary patch literal 131 zcmZSn%**wBJ$qC#0~9aindex" + elif url == '/loing/': + return "

login

" + else: + return "test" + return '

Hello, web!

' +''' +if __name__ == '__main__': + httpd = make_server('', 8000, RunServer) + print "Serving HTTP on port 8000..." + httpd.serve_forever() \ No newline at end of file diff --git a/djangotest/testsocket.py b/djangotest/testsocket.py new file mode 100644 index 0000000..b694bc8 --- /dev/null +++ b/djangotest/testsocket.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/11/8 23:25 +# @Author : jiayanhua +# @Site : +# @File : socket.py +# @Software: PyCharm Community Edition +import socket + + +def handle_request(client): + buf = client.recv(1024) + client.send("HTTP/1.1 200 OK\r\n\r\n") + client.send("Hello, Seven") + + +def main(): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.bind(('localhost', 8000)) + sock.listen(5) + + while True: + connection, address = sock.accept() + handle_request(connection) + connection.close() + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/list_vm.py b/list_vm.py new file mode 100644 index 0000000..2b560d0 --- /dev/null +++ b/list_vm.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +#auth :jyh +import sys +try: + import libvirt + HAS_LIBVIRT=True +except Exception: + HAS_LIBVIRT=False +def is_virtual(): + """ + 判断当前系统是不是支持虚拟化 + """ + if not HAS_LIBVIRT: + sys.exit("current system not support virt") + return 'virt' +def get_conn(): + ''' + 获取libvirt连接句柄,用户提供libvirt接口 + ''' + if is_virtual() == 'virt': + try: + conn=libvirt.open('qeum:///system') + except Exception as e: + sys.exit(e) + return conn + +def close_conn(conn): + ''' + 关闭conn 连接 + :param conn: + :return: + ''' + return conn.close() +def list_active_vms(): + ''' + 列出所有 + :return: + ''' + vms_list=[] + conn=get_conn() + doamin_list=conn.listDoaminsID() + for id in doamin_list: + vms_list.append(conn.lookupByID(id).name()) + close_conn(conn) + return vms_list +def list_inactive_vms(): + ''' + 列出关闭的机器 + :return: + ''' + vms_list=[] + conn=get_conn() + for id in conn.listDefinedDomains(): + vms_list.append(id) + close_conn(conn) + return vms_list +def list_all_vms(): + ''' + + :return: + ''' + vms=[] + vms.extend(list_active_vms()) + vms.extend(list_inactive_vms()) + return vms +def get_capability(): + ''' + + :return: + ''' + conn=get_conn() + capability=conn.getCapabilities() + conn.close() + return capability +def get_hostname: + ''' + + :return: + ''' + conn=get_conn() + hostname=conn.getHostname() + conn.close() + return hostname +def get_max_vcpus(): + ''' + + :return: + ''' + conn=get_conn() + max_vcpus=conn.getMaxVcpus(None) + conn.close() + return max_vcpus +if __name__ == "__main__": + print "当前主机%s的虚拟机列表:"%(get_hostname()) + for vms in list_active_vms(): + print vms + diff --git a/psutil.py b/psutil.py new file mode 100644 index 0000000..e69de29 diff --git a/recive.py b/recive.py new file mode 100644 index 0000000..42d0f32 --- /dev/null +++ b/recive.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/9/15 21:37 +# @Author : jiayanhua +# @Site : +# @File : recive.py +# @Software: PyCharm Community Edition + +# !/usr/bin/env python +import pika + +connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) +channel = connection.channel() + +channel.queue_declare(queue='hello') + +print ' [*] Waiting for messages. To exit press CTRL+C' + + +def callback(ch, method, properties, body): + print " [x] Received %r" % (body,) + + +channel.basic_consume(callback, + queue='hello', + no_ack=True) + +channel.start_consuming() \ No newline at end of file diff --git a/sbx.xls b/sbx.xls new file mode 100644 index 0000000000000000000000000000000000000000..951e0ef558695baf143d1c25a685de2d8504b8ac GIT binary patch literal 4915 zcmZ{o1yqyo+s6k;j1&Z_4rIGFy6zLR@63~fsCIx!aw z=2I_w0Z%7aJ2x9R+}%y!pGAn@%fUVls;%20N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b{QfDx zf&b4>|6_%(O0T-FKhjx(f23Ev*wq48r~6NVR?@#_{i^Wl5d0AiVGd_7{rWE>0nx<8 S`}JKQ<_*R)XZF{r0^mP8)^T(I literal 0 HcmV?d00001 diff --git a/send.py b/send.py new file mode 100644 index 0000000..da5f051 --- /dev/null +++ b/send.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/9/15 21:36 +# @Author : jiayanhua +# @Site : +# @File : send.py +# @Software: PyCharm Community Edition + +import pika + +connection = pika.BlockingConnection(pika.ConnectionParameters( + host='localhost')) +channel = connection.channel() + +channel.queue_declare(queue='hello') + +channel.basic_publish(exchange='', + routing_key='hello', + body='Hello World!') +print " [x] Sent 'Hello World!'" +connection.close() \ No newline at end of file diff --git a/site_count.py b/site_count.py new file mode 100644 index 0000000..b15203a --- /dev/null +++ b/site_count.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/8/12 19:19 +# @Author : jiayanhua +# @Site : +# @File : site_count.py +# @Software: PyCharm Community Edition +#xlswriter +''' +1、准备 +创建一个Excel文件;创建一个工作表;创建一个图标对象;定义表头,表列;准备7天数据 +2、定义格式 +设置整个工作表格式,边框像素加1; +定义title格式对象,边框加粗,像素1,底色#cccccc; +tiltle 居中,内容加粗 +定义avg边框加粗1,数字格式小数点 +3、插入数据 +4、定义函数 +5、设置图标宽、高、大标题,y轴小标题 +''' + +import xlsxwriter + +workbook = xlsxwriter.Workbook('site_count.xlsx') #create excel file object +worksheet = workbook.add_worksheet() #create sheet object +chart = workbook.add_chart({'type':'column'}) #create chart object +#title +title = [u'业务名称',u'星期一',u'星期二',u'星期三',u'星期四',u'星期五',u'星期六',u'星期日',u'平均流量'] +#列 +buname = [u'业务官网',u'新闻中心',u'购物频道',u'体育频道',u'亲子频道'] +#数据 +data = [[100,150,120,130,111,100,105],[100,150,120,130,111,100,105],[100,150,120,130,111,100,105],[100,150,120,130,111,100,105],[100,150,120,130,111,100,105]] +#定义格式 +format = workbook.add_format() #create fomart object +format.set_border(1) #边框加粗 # + +format_title = workbook.add_format() +format_title.set_border(1)#边框加粗,像素1 +format_title.set_bg_color('#cccccc')#背景色 +format_title.set_align('center') #居中 +format_title.set_bold()#字体加粗 + +format_avg = workbook.add_format() +format_avg.set_border(1) +format_avg.set_num_format('0.00') #设置浮点位 +#插入数据 +worksheet.write_row('A1',title,format_title) +worksheet.write_column('A2',buname,format) +worksheet.write_row('B2',data[0],format) +worksheet.write_row('B3',data[1],format) +worksheet.write_row('B4',data[2],format) +worksheet.write_row('B5',data[3],format) +worksheet.write_row('B6',data[4],format) +#定义 +def chart_series(cur_now): + worksheet.write_formula('I'+cur_now,'=AVERAGE(B'+cur_now+':H'+cur_now+')',format_avg) +#添加一个数据系列到图标 + chart.add_series({ + 'categories':'=Sheet1!$B$1:$H$1', #设置图标标签范围 + 'values':'=Sheet1!$B$'+cur_now+':$H$'+cur_now, #设置图标数据范围 + 'line':{'color':'black'},#设置图标线条属性 + 'name':'=Sheet1!$A$'+cur_now, + }) + +for row in range(2,7): + chart_series(str(row)) + +#chart.set_table() +#chart.set_style(30) +chart.set_size({'width':577,'height':287}) +chart.set_title({'name':u'业务流量报表'}) +chart.set_y_axis({'name':'Mb/s'}) + +worksheet.insert_chart('A8',chart) +workbook.close() + + + + + + diff --git a/testbook.xlsx b/testbook.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..dd61a05c9a604c6bd4ea1508f278b8bbdb7b4127 GIT binary patch literal 6225 zcmeHLWmJ@Hx29nT2|>EMQ~6{(X{2^caGQXMK1 z5*gxGPkUYuM;AL+YY@oImG{?;pU2a|K3YpHHiM7geuw>J=1O-pZ1|4V-VTe&25Jcweu>pX`q{ouNMFQn6I z)JhOirtHw@tnxy$6}ngW9NaDwDj!y|!NvAp;!Re@o99ylrm(syW%tYD#BHgoY-^Hr zPaqr7l&lGZ?DE^6@U)L-&@0rZ73{4JWgeY|`QwqpW+)a{n7BY^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M!RGE2l`)q#r|&sEkuI(x&D8b{Zxh_kX1@uxiT=oKw}H1e g{cqsUKu7%ZKcoPl3Od3PBqZFQZ$yOglKlMkU!MM&^8f$< literal 0 HcmV?d00001 diff --git a/weburlcheck.py b/weburlcheck.py new file mode 100644 index 0000000..adc2723 --- /dev/null +++ b/weburlcheck.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/8/15 21:36 +# @Author : jiayanhua +# @Site : +# @File : weburlcheck.py +# @Software: PyCharm Community Edition + +import os +import sys +import time +import pycurl + + +URL = "http://www.baidu.com" # +c = pycurl.Curl() #创建url对象 +c.setopt(pycurl.URL,URL) #定义请求URL常量 +c.setopt(pycurl.CONNECTTIMEOUT,5) #定义http请求等待时间 +c.setopt(pycurl.TIMEOUT,5) #请求超时时间 +c.setopt(pycurl.NOPROGRESS,1) #屏蔽下载进度条 +c.setopt(pycurl.FORBID_REUSE,1) #完成交互后强制断开 +c.setopt(pycurl.MAXREDIRS,1) # 重定向最大1 +c.setopt(pycurl.DNS_CACHE_TIMEOUT,30) #dns缓存信息的时间为30 +#wb格式打开文件,存储http头部及内容信息 +indexfile = open(os.path.dirname(os.path.realpath(__file__)) + "/content.txt",'wb') + +c.setopt(pycurl.WRITEHEADER,indexfile) #http header 写入文件 +c.setopt(pycurl.WRITEDATA,indexfile) #http 内容写入文件 + +try: + c.perform() #提交请求 +except Exception,e: + print "connect is error " + str(e) + indexfile.close() + c.close() + sys.exit() + +NAMELOOKUP_TIME = c.getinfo(c.NAMELOOKUP_TIME) +CONNECT_TIME = c.getinfo(c.CONNECT_TIME) +PRETRANSFER_TIME = c.getinfo(c.PRETRANSFER_TIME) +STARTTRANSFER_TIME = c.getinfo(c.STARTTRANSFER_TIME) +TOTAL_TIME = c.getinfo(c.TOTAL_TIME) +HTTP_CODE = c.getinfo(c.HTTP_CODE) +SIZE_DOWNLOAD = c.getinfo(c.SIZE_DOWNLOAD) +HEADER_SIZE = c.getinfo(c.HEADER_SIZE) +SPEED_DOWNLOAD = c.getinfo(c.SPEED_DOWNLOAD) + +#print all +print "HTTP状态码: %s" %(HTTP_CODE) +print "DNS解析时间: %.2f ms" %(NAMELOOKUP_TIME * 1000) +print "建立连接时间: %.2f ms" %(CONNECT_TIME * 1000) +print "准备传输时间: %.2f ms" %(PRETRANSFER_TIME * 1000) +print "开始传输时间: %.2f ms" %(STARTTRANSFER_TIME * 1000) +print "传输结束总时间: %.2f ms" %(TOTAL_TIME * 1000) +print "下载包数据大小: %d bytes/s" %(SIZE_DOWNLOAD) +print "HTTPhead 大小: %d bytes/s" %(HEADER_SIZE) +print "平均下载速度: %d bytes/s" %(SPEED_DOWNLOAD) + +#关闭文件 +indexfile.close() +c.close() + + + + + + diff --git a/xls.py b/xls.py new file mode 100644 index 0000000..9fdfbdc --- /dev/null +++ b/xls.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/8/12 9:36 +# @Author : jiayanhua +# @Site : +# @File : xls.py +# @Software: PyCharm Community Edition +import xlsxwriter + +workbook = xlsxwriter.Workbook('xls.xlsx') +worksheet = workbook.add_worksheet() + +worksheet.set_column('A:A',20) +bold=workbook.add_format({'bold':True}) + +worksheet.write('A1','Hello word') +worksheet.write('A2','taiyan',bold) + +worksheet.write(2,0,32) +worksheet.write(3,0,23.5) +worksheet.write(4,0,'=SUM(A3:A4)') + +workbook.close() + + diff --git a/xls.xlsx b/xls.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..ba1049a13e593c55c72860f4587f5798db724941 GIT binary patch literal 5389 zcmZ`-1yoe+79Bu@p+N>|X=w%|M7leMP(na*$N>frq(cyC5R~plN)V6^rG^xw8>G8K z;EnqJ=aco`%$obHd)Mr<*0;|+=j{EdE1}&Y1^@tXvtagb(TgFiK1bKZREWrHJR}JB>YOCL4Fh;)dX+BUJXj@faP~C8V z@AX^QW$v>ZjR0#;OnWQLT;rI;_KW;0wpWGwd`4x-@0WNcyU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Mon Sep 17 00:00:00 2001 From: jiayanhua <1808996884@qq.com> Date: Sun, 19 Nov 2017 18:56:54 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- django_08day11/adminx/__init__.pyc | Bin 130 -> 143 bytes django_08day11/adminx/admin.pyc | Bin 0 -> 264 bytes django_08day11/adminx/migrations/__init__.pyc | Bin 0 -> 154 bytes django_08day11/adminx/models.pyc | Bin 0 -> 261 bytes django_08day11/adminx/urls.py | 2 +- django_08day11/adminx/urls.pyc | Bin 1281 -> 1243 bytes django_08day11/django_08day11/__init__.pyc | Bin 139 -> 151 bytes django_08day11/django_08day11/settings.py | 16 ++++++- django_08day11/django_08day11/settings.pyc | Bin 2591 -> 2801 bytes django_08day11/django_08day11/urls.py | 2 +- django_08day11/django_08day11/urls.pyc | Bin 1215 -> 1178 bytes django_08day11/django_08day11/wsgi.pyc | Bin 611 -> 623 bytes django_08day11/web/__init__.pyc | Bin 128 -> 140 bytes django_08day11/web/admin.pyc | Bin 0 -> 261 bytes django_08day11/web/migrations/0001_initial.py | 29 ++++++++++++ .../web/migrations/0001_initial.pyc | Bin 0 -> 1215 bytes django_08day11/web/migrations/__init__.pyc | Bin 0 -> 151 bytes django_08day11/web/models.py | 43 ++++++++++++++++++ django_08day11/web/models.pyc | Bin 0 -> 3102 bytes django_08day11/web/urls.py | 2 +- django_08day11/web/urls.pyc | Bin 1238 -> 1200 bytes django_08day11/web/views.pyc | Bin 960 -> 1020 bytes 22 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 django_08day11/adminx/admin.pyc create mode 100644 django_08day11/adminx/migrations/__init__.pyc create mode 100644 django_08day11/adminx/models.pyc create mode 100644 django_08day11/web/admin.pyc create mode 100644 django_08day11/web/migrations/0001_initial.py create mode 100644 django_08day11/web/migrations/0001_initial.pyc create mode 100644 django_08day11/web/migrations/__init__.pyc create mode 100644 django_08day11/web/models.pyc diff --git a/django_08day11/adminx/__init__.pyc b/django_08day11/adminx/__init__.pyc index 14c0808c6356c1c25111c04b51d5733964260eda..06adda118c0a54721725b3db366adad5a68d81ab 100644 GIT binary patch delta 67 zcmZo->}O;m@N=tAeyP1In0|SGrRZKxqepYI7NlZayNk)ENd`W6?NlZ#sVqSWF Wyn#hZVx^&BOkzrIW?sd_1SJ5q!xmTo delta 54 zcmeBYY+__*{>;mDBbQ?$yP2{!0|SGrRZMC{Vs1fBYD`L2VqSWFyn#hZVx^&BOkzrI JX5PeHB>=B)5fcCa diff --git a/django_08day11/adminx/admin.pyc b/django_08day11/adminx/admin.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53ab67c62044dcda6f38532c847d37f2a0dfb54f GIT binary patch literal 264 zcmYL^K?=e!5Je}cf(S~zgNx!qbRmd{xN+-3ccl<&6E%`1rI~_W$?JIlomjyk{F%p} zpOEM^=szc;w18i6>RaI8$23Sf3=BZYAZ5S;b1)pr2-1i+f@9L5Mg68q7)=PV4qlsbAwH-gg6iZ4oT!Kw-+}poW)w74&l}$n1AsL!rdyX uYIjowX4M0)&I(i>vorrxDI@uVt34irLV*UZU&pbo` literal 0 HcmV?d00001 diff --git a/django_08day11/adminx/migrations/__init__.pyc b/django_08day11/adminx/migrations/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82283e868c67d5bb8d640d2a5639496d047e4644 GIT binary patch literal 154 zcmZSn%*(Y(OE4;#0SXv_v;zW(CZ7c>?r$P=}KN-ybjW5{tp5<1K*tNf z*ws~Uo%S`m!T2yu9x!Pk`|xo!aSB1}uaU>WX}t#{egxRYbjLoopZj<*i~1eH3iSO= work`06|3`wPkpD^1y++$zpkyh6ooRjt-EhEy_sWi4(kSV^llqJ8X_#@Kh)1V3;+NC literal 0 HcmV?d00001 diff --git a/django_08day11/adminx/urls.py b/django_08day11/adminx/urls.py index 020dbf7..97a3930 100644 --- a/django_08day11/adminx/urls.py +++ b/django_08day11/adminx/urls.py @@ -21,7 +21,7 @@ from web.views import index,login,list urlpatterns = [ - url(r'^admin/', admin.site.urls), + #url(r'^admin/', admin.site.urls), #url 对应- 函数 url(r'^index/', index), url(r'^login/',login), diff --git a/django_08day11/adminx/urls.pyc b/django_08day11/adminx/urls.pyc index 4513a44dee6cc2a9b54370ef67a3304678371404..7841218463b1752647ea1862cb070053d30a3857 100644 GIT binary patch delta 169 zcmZqVy3Hxg{F#?4#7HnInE?tofwTh<7f+ig9b?bV(9Fb;%EXYu&XCFhV{Cf0 zAa*7rLkbr|3O9pUGc!Xv3qur;!^04)!MpLqW2VX5nG+bfCrhxTOzvZmmofpG?P?WM sP?VpQnp_f7P+5|ZpBG<}T3j-DH;aLY08pBZQ2+#)WLS6@d6;+@0h~!8djJ3c delta 202 zcmcc3*~lf${F#^QffjdEG6NKF0ci&yE?zNFIwp{XA&ZM4i<_aDi6NDVA%&eGl^w?B zU`XYFu{jx1Ibm!r5Id8RA%&YEg@?hcnVBJ-l_83UA%&MASc7llw#Q6ti7C06dHRzl zGp8}~PX5K5BFF-=Fta4J1jHyU$|;^4%c8)i0pz$^#iUjw<`(3nPM*$UASMJ9Vq+8l PK_(d{AtoM19v}t)BT6Pr diff --git a/django_08day11/django_08day11/__init__.pyc b/django_08day11/django_08day11/__init__.pyc index 28cc62a5a29127819b2369832d1671113a5cbd21..be2a40afe7e3da205fbd84c26c50686907bb80a6 100644 GIT binary patch delta 45 zcmeBXoX*J3{F#?)m6qT{b~7ml1_lOKtC)hK{H)aEl9+$D(l8N3903d1( AQ2+n{ delta 33 ocmbQv*v-h!{F#?)axTY2b~8Q`1_lOKtC-Y^#N2|M)QRB^0FWpNKmY&$ diff --git a/django_08day11/django_08day11/settings.py b/django_08day11/django_08day11/settings.py index 417a286..eea5a90 100644 --- a/django_08day11/django_08day11/settings.py +++ b/django_08day11/django_08day11/settings.py @@ -37,6 +37,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'web', ] MIDDLEWARE = [ @@ -75,8 +76,19 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'test', + 'USER': 'root', + 'PASSWORD': '', + 'HOST': 'localhost', + 'PORT': '3306', + 'OPTIONS': { + #"unix_socket": "/data/mysql5.6/mysql.sock", + 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'" , + #'charset': 'utf8mb4', + 'charset': 'utf8', + + }, } } diff --git a/django_08day11/django_08day11/settings.pyc b/django_08day11/django_08day11/settings.pyc index 62a3ab2005362982e8d36cb11813e031af9ffd9c..d5c5377e78152b7a3474d0be7b918589783304d3 100644 GIT binary patch delta 636 zcmYLG%Wl&^6g_sL*h!nVNt2Q`JW30s6bOZYg?LB}U_m8FP;7)Ws$?a;CJz$3#Dh>* z5j$2$kPqM^vSYztuw%;yRQv!pZfHH8d(PZ@e0*o-d+sP-jQvfgQV%l1#q7}-cX@`r zuSIu6DYP|+IS{||pfqR!v&Ea(ozGPq}vi()>C3oD?z5Zu2CYs;8; z%BHHz7$46^uQmA`J5omlUQn;;w}UdZ%B`mR&hsfO4-UikeVO2*S$nouGi98q^gsAGpnaCzyTuyl&Z%N2Ri3$hbXK*Bf@Y z!NfA{b^fh02*`U>vh2p*6Wg&H)tcql)yFSPt0d=H*7dv6af892=~HC&LB72wrx)*b zn#0hOlOG9FQ3~Jm-{U{}m$hB4nD_S&hC$DB<^I8;>;%3u-OTt?@}c67eT6o@I1 z2I4#o(m^Ru8kB*PfM6yIp~H=XWX#aF-q0NcFUhCWPB^-IX5X~? gS3Ns8(DtPB;9e^Rui9p%nv6*a`9E}3k^i>x3zOPYE&u=k diff --git a/django_08day11/django_08day11/urls.py b/django_08day11/django_08day11/urls.py index a2634c7..50360d9 100644 --- a/django_08day11/django_08day11/urls.py +++ b/django_08day11/django_08day11/urls.py @@ -27,5 +27,5 @@ # file -- funcation #url(r'^web/',include('web.urls')), url(r'^web/',include('web.urls')), - url(r'^adminx/',include('adminx.urls')) + #url(r'^adminx/',include('adminx.urls')) ] diff --git a/django_08day11/django_08day11/urls.pyc b/django_08day11/django_08day11/urls.pyc index 92b82c09951cd648805cae08475a0378d743d60a..f72fe5f6d5c787de7709bae336656a56abd21357 100644 GIT binary patch delta 103 zcmdnbIg3-8`7zE^e48UCEQq#1O^9kiy9jtiiQ#6Z7Qr%rm5H ufU>SuF$G2WS*gh-F$I++8TonfC8@WaR$Rxug#0mhE3l@n0 delta 136 zcmbQmxt~*-`76GI9oLncMI1es)*gjj_b0XZ!iq5uE@ diff --git a/django_08day11/django_08day11/wsgi.pyc b/django_08day11/django_08day11/wsgi.pyc index 2505e7f6635829c436980f33d9e729c061af78ae..73758e5b7f81259caf0267278f2b3934eaf769ce 100644 GIT binary patch delta 47 zcmaFN@}7mA`7|9JzHVh05u2wMxMfq8&$t5ubl_eSZdGRHw#U+#FnOp!- C9S+q1 delta 35 qcmaFQ@|cC4`7|9KI1`G@gu2wOr6^Xe8IjNJinOp$04GF{m diff --git a/django_08day11/web/__init__.pyc b/django_08day11/web/__init__.pyc index 0c367096c7ba373a2a6d3699d492a1cee7a6b3e6..8b51474f27f9873c4c4a45d16aa19f73904a8b30 100644 GIT binary patch delta 45 zcmZo*>|tbQ{>;m@N=tAeyP1?J0|SGrRZKxqepYI7NlZayNk)ENd`W6?$wY5c02^2i AB>(^b delta 33 ocmeBSY+z(({>;nep}{?o-HcC@fq}u*DkileF}ENmbz-Pke!jawJGD}m59Q6p(0%@pxUUe5#QL(V*xsumBZ`HPNEJdzG*pKsQf;giJLCO=g|o*bttx~ylSjo$B%|61O5i|fja&G literal 0 HcmV?d00001 diff --git a/django_08day11/web/migrations/0001_initial.py b/django_08day11/web/migrations/0001_initial.py new file mode 100644 index 0000000..88c44a4 --- /dev/null +++ b/django_08day11/web/migrations/0001_initial.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-11-19 08:01 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='UserInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('username', models.CharField(max_length=50)), + ('password', models.CharField(max_length=50)), + ('Gender', models.BooleanField(default=False)), + ('Age', models.IntegerField(default=19)), + ('memo', models.TextField(default='xxx')), + ('Createdate', models.DateTimeField(default='2017-11-19 15:32:00')), + ('address', models.CharField(max_length=100)), + ], + ), + ] diff --git a/django_08day11/web/migrations/0001_initial.pyc b/django_08day11/web/migrations/0001_initial.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b7e94601049a0cfccac8eada32952bfa9756e03f GIT binary patch literal 1215 zcmb_bOK;Oa5FR^^Hhs{R(!!A&xwMLl5D+0m9~4!n9MWNh|);HurEIOZ2U?SL$|O@q(Pu+SK%#$l;a z+YWhUjfTu5rE;dot>b+ed8O91$h=&v{9(F9=m|6ZK?VX7#E@wvWY+;3FmBE>Aks{7 z1;(q)klctGk4?Z9=oQeb#JN5qq$O@^py^vDFko=wU*M*I>!9y(kh$lUfEx_z?FG0a z;HH507vQddC&%r%y7g-nej<4 literal 0 HcmV?d00001 diff --git a/django_08day11/web/migrations/__init__.pyc b/django_08day11/web/migrations/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a2c94cdaaf5105fab6c9904eb78cf5342c78948 GIT binary patch literal 151 zcmZSn%*(Y(OE4;#0SXv_v;zCa`RJ4b5iX{NR_}6YKapeAVL*w;)Dn_NZWA0inQ8zCiX__U2A7n zaU>2%DTpIT9DoB7Cph&8QvV+sIP(X<``*M}(f9L+VKSIU*9G=ZKag9E@ENxuRDPtpbe;LKVbOQ5-r#7R7xbPKEfi zRT8o^rYMgTWg(}=6qS);O33Lk#mq=i5ps4+F*j073pqcgSQsg0gsh5t^+hs2{F^>? zhk6FXEDqa=RDKj1l?IWvnlfp6B#yMHV3Jm;Iq9o^Iphu;a-FnFzz@n5M}>3eoC>E^ zgjeYBba3xp9Ue3@STz{c&A&`_^?kP9_vytfqM^qg#2XvkAl(X8Bt6*Z;l_-Ik|Imy zSTfI&5=$0XVk2K>NtGpwfb}V*$TcAu)2$@{0Uq;!hH#Y{_P$hyK^B?t1rlUX4F-b@ zgVmMBJ2x7Q8;$pt8*i_#t*)=Egc6e~Xoi>^q6hy^KoCcV(c_h9W*(xaMGi;$C0c3- z8JO%LTpsLWfOt6WD1`td9`pmPkCRlIIa1$Al1K$HL&(6iElNXWfTL{{OUgXV+KG+o zC<`biyy`3gm|01NX(;HVo`f-BEarIwm<=KGZ6&!Vp zM=k{g9KB0`n5d&)rbTPm9jh~8paa6V=-ExuT;6nTOB6^ZgU1B91H2}j#4LdW( z1erO0F6Kz0k9>|ahWG~H>LBhA0b9^QpjI%zvJkAN2dr!^6 z%e3t4^k@*K^_{gr^>R7^9JyY3i#pbER9i_Zi)KZa$~JNqmu!-YF}knFWv9ZmwF~Gs z1B@FPx{tnp@aN}0oPGPtqpyBr@hXeY9{hCn^_OGfwG2r5koPsm$?$&{X^K$AiGg*pqibR6%Gh3|Pln1uLLgenE66IpZ!%gCW@=Wd5SNSf~|i3$;?MQY-xfCE0fj literal 0 HcmV?d00001 diff --git a/django_08day11/web/urls.py b/django_08day11/web/urls.py index 77c6c2e..f422917 100644 --- a/django_08day11/web/urls.py +++ b/django_08day11/web/urls.py @@ -19,7 +19,7 @@ from django.contrib import admin from web.views import index,login,list urlpatterns = [ - url(r'^admin/', admin.site.urls), + # url(r'^admin/', admin.site.urls), #url 对应- 函数 url(r'^index/', index), url(r'^login/',login), diff --git a/django_08day11/web/urls.pyc b/django_08day11/web/urls.pyc index b458fe28f3f82ce4e5e80c541149b605211d8292..cdf81b6df6a8b59c713e634004953f8df25be9e2 100644 GIT binary patch delta 167 zcmcb{xq(xf`7Ci7C06dHR!! zn9~?}Cf{U^7i0lhm|2oq0%DXF?~c diff --git a/django_08day11/web/views.pyc b/django_08day11/web/views.pyc index 63172d96204a15e73d6c60729dfae9ef5deb839e..005249dc0709e327ee7a37d75d6399a7e12bf283 100644 GIT binary patch delta 186 zcmX@W{)e5N`7_4Q87#J8_tzrs_^0QKtOJWKtOEU8F;!9GCOD11rlAWx@ dm__7O_7#J8_tzuFu5_1c3QYSMq%T6|9%)%yooiQ0xSY~no QQ#q#aVoV{~$+wvm0m(iiQ~&?~ From 0db90921e52afa3530e7345356591b5519c414d7 Mon Sep 17 00:00:00 2001 From: jiayanhua <1808996884@qq.com> Date: Sun, 19 Nov 2017 20:21:57 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- django_08day11/web/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/django_08day11/web/views.py b/django_08day11/web/views.py index 8938212..9f05c7e 100644 --- a/django_08day11/web/views.py +++ b/django_08day11/web/views.py @@ -3,6 +3,7 @@ from django.shortcuts import render from django.http.response import HttpResponse +from # Create your views here. def login(): return "login" From cd71f8a003eb262370473d0862e7eda45d10f8f2 Mon Sep 17 00:00:00 2001 From: jiayanhua <402602239@qq.com> Date: Fri, 24 Nov 2017 12:37:20 +0800 Subject: [PATCH 05/11] 1124 --- django_08day11/.idea/workspace.xml | 82 +++++++++++++++++---- django_08day11/django_08day11/__init__.pyc | Bin 151 -> 139 bytes django_08day11/django_08day11/settings.pyc | Bin 2801 -> 2789 bytes django_08day11/web/__init__.pyc | Bin 140 -> 128 bytes django_08day11/web/models.py | 10 +++ 5 files changed, 77 insertions(+), 15 deletions(-) diff --git a/django_08day11/.idea/workspace.xml b/django_08day11/.idea/workspace.xml index 1f0f403..dddb5c1 100644 --- a/django_08day11/.idea/workspace.xml +++ b/django_08day11/.idea/workspace.xml @@ -11,18 +11,50 @@
- + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + @@ -92,10 +124,11 @@ - + - + @@ -239,9 +267,7 @@ - - - + @@ -320,14 +346,40 @@ + + + + + + + + - + - + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/django_08day11/django_08day11/__init__.pyc b/django_08day11/django_08day11/__init__.pyc index be2a40afe7e3da205fbd84c26c50686907bb80a6..28cc62a5a29127819b2369832d1671113a5cbd21 100644 GIT binary patch delta 33 ocmbQv*v-h!{F#?)axTY2b~8Q`1_lOKtC-Y^#N2|M)QRB^0FWpNKmY&$ delta 45 zcmeBXoX*J3{F#?)m6qT{b~7ml1_lOKtC)hK{H)aEl9+$D(l8N3903d1( AQ2+n{ diff --git a/django_08day11/django_08day11/settings.pyc b/django_08day11/django_08day11/settings.pyc index d5c5377e78152b7a3474d0be7b918589783304d3..3ce96ce51df3ef931576d4d22696470fbecaaf55 100644 GIT binary patch delta 35 rcmew;`c#yi`7`GjGCJYP=u2wOr6^Xe8IjNJKxz+&y!I28g delta 47 zcmaDV`cagf`7;nep}{?o-HcC@fq}u*DkileF}ENmbz-|tbQ{>;m@N=tAeyP1?J0|SGrRZKxqepYI7NlZayNk)ENd`W6?$wY5c02^2i AB>(^b diff --git a/django_08day11/web/models.py b/django_08day11/web/models.py index e2d6891..3bcbe14 100644 --- a/django_08day11/web/models.py +++ b/django_08day11/web/models.py @@ -4,6 +4,7 @@ from django.db import models # Create your models here. +<<<<<<< Updated upstream class usertype(models.Model): name = models.CharField(max_length=20) def __str__(self): @@ -47,3 +48,12 @@ class Temp(models.Model): (u'3',u'超级管理员') } usertype2 = models.CharField(max_length=20,choices = GENDER_CHOICE) +======= +class UserInfo(models.Model): + username = models.CharField(max_length=50) + password = models.CharField(max_length=50) + Gender = models.BooleanField(default=False)#性别,布尔型 + Age = models.IntegerField(default='18') #整型 + memo = models.TextField(default='xxx') # 文本 + CreateDate = models.DateTimeField(default='20171118') +>>>>>>> Stashed changes From 037f10942c19c1b8eea54e729b5b33aeeb6c7331 Mon Sep 17 00:00:00 2001 From: jiayanhua <402602239@qq.com> Date: Fri, 24 Nov 2017 13:24:27 +0800 Subject: [PATCH 06/11] 20171124 --- django_08day11/django_08day11/urls.pyc | Bin 1178 -> 1166 bytes django_08day11/django_08day11/wsgi.pyc | Bin 623 -> 611 bytes django_08day11/web/admin.pyc | Bin 261 -> 249 bytes .../web/migrations/0001_initial.pyc | Bin 1215 -> 1191 bytes django_08day11/web/migrations/__init__.pyc | Bin 151 -> 139 bytes django_08day11/web/models.py | 4 +--- django_08day11/web/models.pyc | Bin 3102 -> 3358 bytes django_08day11/web/urls.py | 2 +- django_08day11/web/urls.pyc | Bin 1200 -> 1229 bytes django_08day11/web/views.py | 12 ++++++++++-- django_08day11/web/views.pyc | Bin 1020 -> 1455 bytes 11 files changed, 12 insertions(+), 6 deletions(-) diff --git a/django_08day11/django_08day11/urls.pyc b/django_08day11/django_08day11/urls.pyc index f72fe5f6d5c787de7709bae336656a56abd21357..f0119990a5c8bada3470e596d577d73f897b6c13 100644 GIT binary patch delta 35 qcmbQm*~iJw{F#@lZNB(Mc0(3E0|o{LSF4!Rip1Q4oYcudEFJ)-lL@W> delta 47 zcmeC|9KI1`G@gu2wOr6^Xe8IjNJinOp$04GF{m delta 47 zcmaFN@}7mA`7|9JzHVh05u2wMxMfq8&$t5ubl_eSZdGRHw#U+#FnOp!- C9S+q1 diff --git a/django_08day11/web/admin.pyc b/django_08day11/web/admin.pyc index e993dd370c90085fd7a2d6c3c84724c0b6415abc..81663a9d3f09e159d7c2acd3704442e1e37682d0 100644 GIT binary patch delta 33 pcmZo=`pL-7{F#^QYA(k__6>Y$3=9meRxzm+iMa(isS_`n0063h3b_CP delta 45 zcmey#*viDt{F#?)m6qT{_6<@-3=9meRxt%d`B|ySB{2n+B^mj7@g=FnB@>UD002Jx B4~PH& diff --git a/django_08day11/web/migrations/0001_initial.pyc b/django_08day11/web/migrations/0001_initial.pyc index b7e94601049a0cfccac8eada32952bfa9756e03f..68b5edefed1bfc7eb73e7b9bc06c0e0a4b529d39 100644 GIT binary patch delta 58 ycmdnbxtx=o`7;VA((GkP| delta 82 zcmZ3^xu27r`7V_Jzz+E({C|u2wMxMfq8&$t5ubl_eSZdGRHw#U+#DS@b49 KVa~;`!~*~+H5+08 diff --git a/django_08day11/web/migrations/__init__.pyc b/django_08day11/web/migrations/__init__.pyc index 9a2c94cdaaf5105fab6c9904eb78cf5342c78948..3c5e1a203c8b4d99a33eede30bd1321a4b5ffd27 100644 GIT binary patch delta 33 ocmbQv*v-h!{F#^QYA(k_b~8Q`1_lOKtC-Y^#N2|M)QRB^0G3z@f&c&j delta 45 zcmeBXoX*J3{F#?)m6qT{b~7ml1_lOKtC)hK{H)aEl9+$D(l8N3903d1( AQ2+n{ diff --git a/django_08day11/web/models.py b/django_08day11/web/models.py index 3bcbe14..140f910 100644 --- a/django_08day11/web/models.py +++ b/django_08day11/web/models.py @@ -4,7 +4,6 @@ from django.db import models # Create your models here. -<<<<<<< Updated upstream class usertype(models.Model): name = models.CharField(max_length=20) def __str__(self): @@ -48,7 +47,7 @@ class Temp(models.Model): (u'3',u'超级管理员') } usertype2 = models.CharField(max_length=20,choices = GENDER_CHOICE) -======= + class UserInfo(models.Model): username = models.CharField(max_length=50) password = models.CharField(max_length=50) @@ -56,4 +55,3 @@ class UserInfo(models.Model): Age = models.IntegerField(default='18') #整型 memo = models.TextField(default='xxx') # 文本 CreateDate = models.DateTimeField(default='20171118') ->>>>>>> Stashed changes diff --git a/django_08day11/web/models.pyc b/django_08day11/web/models.pyc index 03d765613b3e6dbdbc786febbae43eea12957894..99c7e6857cf1322f02ee16a855a4407e056275dc 100644 GIT binary patch delta 553 zcmbOyF;7aG`77yLPn6yz$I6h(%#g*xkjBW6!q3pcz|hRV z5E;eBkRrektRXn@)@?p@pn6xUnAD2I+=86c$>$lH(1rRra=pRCUE37c>r z>t<}iHf(O#gmw|=0Xk@bf;|Y=WIe3n+$aJWKV8UVU&<@0)31VDr!h!6r1!XQEfM2G^35-uR&T$GwvlIjA)8bBTcf+$9d2B705 vK^lyKxEN#?8>0{$PLAVFMGu+tjB=BIa|?=q+#tXtz%0ok$tTGw$pOLunp<~E delta 455 zcmbOyHBUmC`7}nNLP?VpQ znp_f7P+5|ZpBG<}T3j;OkVkg%PsUXIO5`?oF{LpQP%~MEx L`6O8-IV4#DPiT!d diff --git a/django_08day11/web/urls.py b/django_08day11/web/urls.py index f422917..3e45fe2 100644 --- a/django_08day11/web/urls.py +++ b/django_08day11/web/urls.py @@ -17,7 +17,7 @@ """ from django.conf.urls import url from django.contrib import admin -from web.views import index,login,list +from web.views import index,login,list,Add,Delete urlpatterns = [ # url(r'^admin/', admin.site.urls), #url 对应- 函数 diff --git a/django_08day11/web/urls.pyc b/django_08day11/web/urls.pyc index cdf81b6df6a8b59c713e634004953f8df25be9e2..d21c80b1d33c0ccc11ece328dbf688b3fee9f324 100644 GIT binary patch delta 159 zcmdnMd6rX}`7xOmb;X&3HXPKGE>hFmU&D6WZd4vgFz=Wk*% zVFgN;fQZbzl++3^DxVNvE&1u|W&Vp1y-a|?1(Cl|7qb7-*eF!C_*FaiMMMlqoW{sC z`3G~{fgc5S_J?CQe!uCr}J>1 z!{@*G7Yaspz)d~Rvr?)==T=pzHqFQ$k5pE03|QrP2y zt1B~H+}M?)F0V0gP9j58yf9t#9s}zL+&$!wv!rWBKEmWiMu$!e7f)ut3I-c1V9^U3)l6QxZwSr}Rv7^2u1Qdq$Zc7_x-mlhIFubMi$Nf6E|{K|!n_f&)k(96*FCWG1(>3JLH4wFxi@FbXhn HGJ_xh8WLAs From bc421d98708e19d6ce5ab0d620c7c61d32eaa177 Mon Sep 17 00:00:00 2001 From: jiayanhua <402602239@qq.com> Date: Fri, 24 Nov 2017 13:44:30 +0800 Subject: [PATCH 07/11] =?UTF-8?q?1050,=20"Table=20=E8=A1=A8=E5=90=8D=20alr?= =?UTF-8?q?eady=20exists.python=20manage.py=20migrate=20myapp=20--fake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/migrations/0002_auto_20171124_1329.py | 72 ++++++++++++++++++ .../migrations/0002_auto_20171124_1329.pyc | Bin 0 -> 2123 bytes .../web/migrations/0003_auto_20171124_1331.py | 20 +++++ .../migrations/0003_auto_20171124_1331.pyc | Bin 0 -> 829 bytes django_08day11/web/models.py | 2 +- django_08day11/web/models.pyc | Bin 3358 -> 3369 bytes 6 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 django_08day11/web/migrations/0002_auto_20171124_1329.py create mode 100644 django_08day11/web/migrations/0002_auto_20171124_1329.pyc create mode 100644 django_08day11/web/migrations/0003_auto_20171124_1331.py create mode 100644 django_08day11/web/migrations/0003_auto_20171124_1331.pyc diff --git a/django_08day11/web/migrations/0002_auto_20171124_1329.py b/django_08day11/web/migrations/0002_auto_20171124_1329.py new file mode 100644 index 0000000..13f5509 --- /dev/null +++ b/django_08day11/web/migrations/0002_auto_20171124_1329.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-11-24 05:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Asset', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('hostname', models.CharField(max_length=30)), + ('create_date', models.DateTimeField(auto_now_add=True)), + ('update_date', models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name='Group', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('Name', models.CharField(max_length=50)), + ], + ), + migrations.CreateModel( + name='Temp', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('usertype2', models.CharField(choices=[('1', '\u666e\u901a\u7528\u6237'), ('2', '\u7ba1\u7406\u7528\u6237'), ('3', '\u8d85\u7ea7\u7ba1\u7406\u5458')], max_length=20)), + ], + ), + migrations.CreateModel( + name='User', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('Name', models.CharField(max_length=50)), + ('Email', models.CharField(max_length=100)), + ('group_relation', models.ManyToManyField(to='web.Group')), + ], + ), + migrations.CreateModel( + name='usertype', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=20)), + ], + ), + migrations.RemoveField( + model_name='userinfo', + name='Createdate', + ), + migrations.RemoveField( + model_name='userinfo', + name='address', + ), + migrations.AddField( + model_name='userinfo', + name='CreateDate', + field=models.DateTimeField(default='20171118'), + ), + migrations.AlterField( + model_name='userinfo', + name='Age', + field=models.IntegerField(default='18'), + ), + ] diff --git a/django_08day11/web/migrations/0002_auto_20171124_1329.pyc b/django_08day11/web/migrations/0002_auto_20171124_1329.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a3293e04d890f22f367dfc26275f5ec135ee5d03 GIT binary patch literal 2123 zcmb_dOK%)S5U!coU3=~L5tGLODZI%N!0fDpFbE+QCqX&bhmAR~T4^-i?j5(8mu9+? zEGMM!I)cOjxN(A$k09}Xh~dl+fU4>pW=YJ!5^Jlc`>X1zuO8j){kgKVb$od^hS|@< z@4Mhaxq}md{|>|ei339i99p{&yO4M=^dM=#uz{!t(u1QWOdJpm_!Qs)z=y*oh$h_W zw9tCghXT$j#?mEAQwO^@VE$a5kwor5)y7qP3o|c~`)`96&tmXWW$-eH9*8Xv z*CE1eU}#s!EQa=|{in`i|1`ql>B=d3d1e-cc$UFs5YK^lz6$M;T)l7>*Dua_p;)L) zbu8%mDu@nO|0Rl)Dl!jVtH6~x&6h#E!e+71uY%Ylvk$Hi8U9d*Y)4w^J>n3Ltrw<2%F8N(Wa^5B$pAd}}1{ zhe;mGkvIy|C=0sVBAojE2-{>-KS?7z%e{b4fURHedf;#M-rUTm13L0VtK7q(<+U4a zr{!LCF5=&lo}E|UYqRxZGTech)#z;4m9xiB=&U9aqfLP|8K4{BWLnCb;()8dRbV!C ZkUaapBIQPT+qT9#6m>}_aNWJ+{SDqT*WUmD literal 0 HcmV?d00001 diff --git a/django_08day11/web/migrations/0003_auto_20171124_1331.py b/django_08day11/web/migrations/0003_auto_20171124_1331.py new file mode 100644 index 0000000..9f154d1 --- /dev/null +++ b/django_08day11/web/migrations/0003_auto_20171124_1331.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-11-24 05:31 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0002_auto_20171124_1329'), + ] + + operations = [ + migrations.AlterField( + model_name='userinfo', + name='CreateDate', + field=models.DateTimeField(default='2017-11-18 00:22:22'), + ), + ] diff --git a/django_08day11/web/migrations/0003_auto_20171124_1331.pyc b/django_08day11/web/migrations/0003_auto_20171124_1331.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb3d0ba543f42d418b898ea98ef0978f7569c9a9 GIT binary patch literal 829 zcmb`F&2H2%5XUE<+pVZn35i}g=F%$8B2g+-0R?VwNVyP2veNZrm6emMHnvL7lAejFWs`+ia_;o*sBd<7v)S7aD!0a$=OfGU81=ONe- z`Ut8B`WUL1yb)jo>jc^WOblNE?g2hm377<~vy|d=Kk3N=vfMFse(08?L2WyS+r~~= z$Sa4`_1$XQxNaOK$N%-T%T8`i=7--ae@NN;hDk5UKwv;KhZT{A!V@zqu@Mr1m=rL9 zbqZz%=70!;dx&`R49e?_&-R@9E#CMO8uL6abmQHqi(EZds(7Z=qIj``WGX#0J^BOw zZ^CUiw4;k@B3_PmwZ+EaTl!o=)3!rv+>9)PZR4%;kIClPr%Iiw^QU=!Q54ifi+@4M z_-x0W78b1qPHPg)TcqhDIc)^J zBcpZLcXBu0UDWuc={FW@vu=jfsPl8v+$mL)hV{OXHA%VnOUi{h+uW6`IA<_1R2t3W zd63fkQ7+9xI<0qpOX-xf1>`F1jyp3ql8|H|k@kRM{Vz(<_~lO3OD3MU(8uAE=ohy! BwPpYS literal 0 HcmV?d00001 diff --git a/django_08day11/web/models.py b/django_08day11/web/models.py index 140f910..8a11a3b 100644 --- a/django_08day11/web/models.py +++ b/django_08day11/web/models.py @@ -54,4 +54,4 @@ class UserInfo(models.Model): Gender = models.BooleanField(default=False)#性别,布尔型 Age = models.IntegerField(default='18') #整型 memo = models.TextField(default='xxx') # 文本 - CreateDate = models.DateTimeField(default='20171118') + CreateDate = models.DateTimeField(default='2017-11-18 00:22:22') diff --git a/django_08day11/web/models.pyc b/django_08day11/web/models.pyc index 99c7e6857cf1322f02ee16a855a4407e056275dc..5717aeb68f461cc5b8e6079291f692fd59555c32 100644 GIT binary patch delta 50 zcmbOywNi?W`7 Date: Fri, 24 Nov 2017 15:44:39 +0800 Subject: [PATCH 08/11] django modle,add,update,delete,get --- django_08day11/web/migrations/0004_test.py | 23 +++++++++++++ django_08day11/web/migrations/0004_test.pyc | Bin 0 -> 976 bytes django_08day11/web/models.py | 5 ++- django_08day11/web/models.pyc | Bin 3369 -> 3618 bytes django_08day11/web/urls.py | 6 +++- django_08day11/web/urls.pyc | Bin 1229 -> 1450 bytes django_08day11/web/views.py | 36 +++++++++++++++++++- django_08day11/web/views.pyc | Bin 1455 -> 2132 bytes 8 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 django_08day11/web/migrations/0004_test.py create mode 100644 django_08day11/web/migrations/0004_test.pyc diff --git a/django_08day11/web/migrations/0004_test.py b/django_08day11/web/migrations/0004_test.py new file mode 100644 index 0000000..787564a --- /dev/null +++ b/django_08day11/web/migrations/0004_test.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.7 on 2017-11-24 06:08 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('web', '0003_auto_20171124_1331'), + ] + + operations = [ + migrations.CreateModel( + name='Test', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('Age', models.IntegerField(default=23)), + ], + ), + ] diff --git a/django_08day11/web/migrations/0004_test.pyc b/django_08day11/web/migrations/0004_test.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cb632032add965cab71bbd9cb86aa87921a5d6a GIT binary patch literal 976 zcmbVKOK%fF4E8?qZc9Ld-ng=-D%%u+5JHqdr5?&5?S&}PXp(WZ6ZWOuS!j?r!GGe1 z@dLni0=XhqE068**q{A5_<7hbe;m)2u=@f!UxN?zgcL)+2Pr`2!OR1XZ68t}vH)fQ zWFgE#@&Io%A+ zU9O-joP99&zzlcJBp}7-S_7C~M-K==!;|}r zi{_Zl(P%VQx^aa%9mUV$`1DN0<8kaly32Kj4J$WTJ85%eF*S9=Q?SMz&>>Hk6>5jZ z4aiYeHq+HceZ-B7qsGeW)P6w;|Af_|s8LC3PILKIDzLqstG-hy=83ztkLg;lo+s!! zWEfoOCUur^3lsm+NyI2!mxPk4N=Y51h_WU{GC9CtiMhdiX|bLP{oKn$`nqCnr@}n* zdrrf;;5o>QZmI@di`*Bq9w;48ZgsT{;LMk~!vuE@-khSORg%q#$b!A7pOX3R#T@T+ zR;D;NYn>;B8a+396UTF6Y`)*RIT3fJ91(L;Zl=sAw^(z=2Lu diff --git a/django_08day11/web/urls.py b/django_08day11/web/urls.py index 3e45fe2..51bc375 100644 --- a/django_08day11/web/urls.py +++ b/django_08day11/web/urls.py @@ -17,7 +17,7 @@ """ from django.conf.urls import url from django.contrib import admin -from web.views import index,login,list,Add,Delete +from web.views import index,login,list,Add,Delete,Update,Get urlpatterns = [ # url(r'^admin/', admin.site.urls), #url 对应- 函数 @@ -26,6 +26,10 @@ #url(r'^list/(\d*)',list), url(r'^list/(?P\d*)/(?P\d*)/$',list),#P,view,django url(r'^list/(?P\d*)/$', list,{'id':222}), # P,view + url(r'^add/(?P\w*)/$',Add),#\d*表示数字 + url(r'^delete/(?P\d*)/$',Delete), + url(r'^update/(?P\d*)/(?P\w*)/$',Update), + url(r'^get/(?P\w*)/$',Get), ] diff --git a/django_08day11/web/urls.pyc b/django_08day11/web/urls.pyc index d21c80b1d33c0ccc11ece328dbf688b3fee9f324..6ce35d5df19f9633cee93e5405e5ede620177efe 100644 GIT binary patch delta 316 zcmX@hxr$qw`7YCrZiXmshFl(oD4vN~Ha4kD3@O|U zshkYWObj444?`*!jLplC$_-=lF{JW<*y$V$QM?Q({0zYw0vk82W@2QY9LH=dT*3yl zAhaMQu_U#G8OU@`Etx!#Ii1jva?Oi9t#un(}wOUzBRiz(OA)K@7M1xci&=A@RS zg5@$(>|#>DGU_0iQm|PlG9VK&@{3E5O_2bpO;0TWD@2p@)8L!@gE@meh#jaXh+}dr bOPrJ#kjcg<0E8wiJd8X{Jd9$DKpF@EI=4m) delta 96 zcmZ3*eU?+2`7xOmb;>41sl);#Gf3{l(+DclUf8ax}{t!83m qoji-#c=7}06lOmSp2>$}Cb9YXh9D#ty5y_%5AG!`Ckb;OPjw(owXwq25y9qwb9c0&$kQ|-R zQKX;=+oh)GH_!qN65@~0Q8DAgqF`4$`*!xt?7Xo*E&u2bykBAP^V^mE9R3bL`$G_5 z-k%NXjduY1A*dB#unH=Ky?FKP{0j!|H{NmQnBoedQ(SX%@e$Wu?0pR{Qwk$FA71o6 z$j`HD{~T8__vpln8ISm-+XO7Y7-1|xA=C(SKShBJIVHFlD{)I@G!8$UGJv5uJ=MRti27b;B; zZ4$U0xp|8n2SsW1QFB+lQkm5WH!5ZwiO;6XCU8&udo$)gZAcNJMJGDfG3N*_or4mKM}2ys4g1rC$ delta 140 zcmca2u%26*`7HfJjDnM`m{0SH0yPw~fOInoGfoy_IVd2B5Rqi`)8L()!Co`jh|zkoCWoMy U5KvNpNq`XunK+rjkcE>40PF)8EdT%j From 63189b4628926e3a25899b1ddd91093c0fd7ab3b Mon Sep 17 00:00:00 2001 From: jiayanhua <402602239@qq.com> Date: Fri, 24 Nov 2017 17:21:17 +0800 Subject: [PATCH 09/11] moduel over --- django_08day11/web/views.py | 6 +++--- django_08day11/web/views.pyc | Bin 2132 -> 2191 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django_08day11/web/views.py b/django_08day11/web/views.py index e9aeb62..b3472a4 100644 --- a/django_08day11/web/views.py +++ b/django_08day11/web/views.py @@ -32,7 +32,7 @@ def Delete(request,id):#删除时,传入id即可 def Update(request,id,hostname): #更新数据库 #更新单条数据 ''' - obj = Asset.objects.get(id=id) + obj = Asset.objects.get(id=id) #get只能获取一条数据,只要获取不到就报错 obj.hostname = hostname obj.save() ''' @@ -40,7 +40,7 @@ def Update(request,id,hostname): #更新数据库 return HttpResponse('ok') def Get(request,hostname): - assetlist = Asset.objects.filter(hostname__contains=hostname) + assetlist = Asset.objects.filter(hostname__contains=hostname) #fileter 获取多条数据,没有数据不会报错。而且与get获取的类型不一样,get获取到一个对象,filter获取多个对象的集合 #for item in assetlist:#循环列出id # print item.id #print assetlist @@ -48,7 +48,7 @@ def Get(request,hostname): #alldata = Asset.objects.all() #所有数据 #print alldata.query #SELECT `web_asset`.`id`, `web_asset`.`hostname`, `web_asset`.`create_date`, `web_asset`.`update_date` FROM `web_asset` - alldata = Asset.objects.all().values('id','hostname') #指定字段 + alldata = Asset.objects.all().values('id','hostname') #映射字段,返回指定字段 print alldata print alldata.query diff --git a/django_08day11/web/views.pyc b/django_08day11/web/views.pyc index d6dcb3819b78e2fa1a801f3b2781f54893c16c5f..30ffc0ceb8196603be8ae364f237fc40025c6207 100644 GIT binary patch delta 86 zcmca2&@afw{F#?)+4+rZO00~1lQmh@tQC~gQ%j!quX@qE_eJ0Kr~T8O>}Ys4cj2?C l8=m#9d%vd#B( Date: Mon, 27 Nov 2017 07:22:41 +0800 Subject: [PATCH 10/11] template --- django_08day11/django_08day11/settings.py | 10 +++++- django_08day11/django_08day11/settings.pyc | Bin 2789 -> 2829 bytes django_08day11/template/assetlist.html | 32 ++++++++++++++++++ django_08day11/template/master/assetlist.html | 32 ++++++++++++++++++ django_08day11/template/master/layout.html | 10 ++++++ django_08day11/web/templatetags/__init__.py | 7 ++++ django_08day11/web/templatetags/tagtest.py | 25 ++++++++++++++ django_08day11/web/urls.py | 3 +- django_08day11/web/urls.pyc | Bin 1450 -> 1506 bytes django_08day11/web/views.py | 8 ++++- django_08day11/web/views.pyc | Bin 2191 -> 2518 bytes 11 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 django_08day11/template/assetlist.html create mode 100644 django_08day11/template/master/assetlist.html create mode 100644 django_08day11/template/master/layout.html create mode 100644 django_08day11/web/templatetags/__init__.py create mode 100644 django_08day11/web/templatetags/tagtest.py diff --git a/django_08day11/django_08day11/settings.py b/django_08day11/django_08day11/settings.py index eea5a90..cf1e3f1 100644 --- a/django_08day11/django_08day11/settings.py +++ b/django_08day11/django_08day11/settings.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + """ Django settings for django_08day11 project. @@ -24,10 +26,16 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +#print BASE_DIR +#TEMPLATE_DIRS = ( + #os.path.join(BASE_DIR,'template'),#join拼接,当前程序路径与后面参数 +#) +#print TEMPLATE_DIRS ALLOWED_HOSTS = [] + # Application definition INSTALLED_APPS = [ @@ -55,7 +63,7 @@ TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [os.path.join(BASE_DIR,'template')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ diff --git a/django_08day11/django_08day11/settings.pyc b/django_08day11/django_08day11/settings.pyc index 3ce96ce51df3ef931576d4d22696470fbecaaf55..750d5138062c89b9ee7adb79151c887d96dbd77e 100644 GIT binary patch delta 365 zcmX|6xlY4C6dc>ZHdeyzgd`jxTp`@oBGEvB_yM}@BF2hrL4t@S8l)7Vr9dg@DEWa@ zRD2EM11M;Dwoq2uH?uplquDS2IbXJZa^C%ANnhiCIfCc1JC85r*KS}SG7*g-ut6U^ z6HNomLj^8afC}X_3l_l=SVl7g&Ovb=N_=`8T!5Z{xIzb91S=vgfmMNJa7ADhToYIa zYXTc!T~bYO6Wl^qaU0wbK@zzOr6-dx?xhh4+aI!nAv;W&bkS4b5%e^83_Szsto?N6 z(^&u&wA43oRXa)ktPH@rh#IYCyV42bc<^R?TUl46IJmvLX~excC5E&~|Dw<}-*-!Whn ztbw!O9I^p0h37ncW*}qW0%RQesuO~XU|lblz-2`PTv4ooYl?MnL(v2`H8lWR;Fd17 z!5xJLau;4EE{ibkl@W#8@4JJ(J1m`ckxB3fG6fz(rlFl>rqsC91U!Lg{QwtD-+MB@ pw)Z-CYE3Qwti0zhLqG9w@$VZI7mV0e=&TEz%ip4g3G<=KNIPd@f diff --git a/django_08day11/template/assetlist.html b/django_08day11/template/assetlist.html new file mode 100644 index 0000000..3f8960d --- /dev/null +++ b/django_08day11/template/assetlist.html @@ -0,0 +1,32 @@ + + + + + assetlist + + +

{{user}}

+ + {% for item in data %} + + + + + + + {% endfor %} +
{{item.id}}{{item.hostname|upper}}{{item.create_date|date:"Y-m-d H:i:s"}}{{item.update_date|date:"Y-m-d H:i:s"}}
+ + {% if user %} +

zhen

+ {% else %} +

jia

+ {% endif %} + + {% ifequal user 'jiayanhua' %} +

jiayanhua

+ {% else %} +

非 jiayanhua

+ {% endifequal %} + + \ No newline at end of file diff --git a/django_08day11/template/master/assetlist.html b/django_08day11/template/master/assetlist.html new file mode 100644 index 0000000..3f8960d --- /dev/null +++ b/django_08day11/template/master/assetlist.html @@ -0,0 +1,32 @@ + + + + + assetlist + + +

{{user}}

+ + {% for item in data %} + + + + + + + {% endfor %} +
{{item.id}}{{item.hostname|upper}}{{item.create_date|date:"Y-m-d H:i:s"}}{{item.update_date|date:"Y-m-d H:i:s"}}
+ + {% if user %} +

zhen

+ {% else %} +

jia

+ {% endif %} + + {% ifequal user 'jiayanhua' %} +

jiayanhua

+ {% else %} +

非 jiayanhua

+ {% endifequal %} + + \ No newline at end of file diff --git a/django_08day11/template/master/layout.html b/django_08day11/template/master/layout.html new file mode 100644 index 0000000..a66d6ae --- /dev/null +++ b/django_08day11/template/master/layout.html @@ -0,0 +1,10 @@ + + + + + assetlist + + + + + \ No newline at end of file diff --git a/django_08day11/web/templatetags/__init__.py b/django_08day11/web/templatetags/__init__.py new file mode 100644 index 0000000..c33ca17 --- /dev/null +++ b/django_08day11/web/templatetags/__init__.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/11/26 14:18 +# @Author : jiayanhua +# @Site : +# @File : __init__.py.py +# @Software: PyCharm Community Edition \ No newline at end of file diff --git a/django_08day11/web/templatetags/tagtest.py b/django_08day11/web/templatetags/tagtest.py new file mode 100644 index 0000000..e0ea6df --- /dev/null +++ b/django_08day11/web/templatetags/tagtest.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/11/26 14:20 +# @Author : jiayanhua +# @Site : +# @File : tag.py +# @Software: PyCharm Community Edition +from django import template +#from django.utils.safestring import mark_safe +from django.template.base import resolve_variable, Node, TemplateSyntaxError + +register = template.Library() + + +@register.simple_tag +def mymethod(v1):#自定义 + result = v1*1000 + return result + +''' +@register.simple_tag +def my_input(id, arg): + result = "" % (id, arg,) + return mark_safe(result) +''' \ No newline at end of file diff --git a/django_08day11/web/urls.py b/django_08day11/web/urls.py index 51bc375..386bcf5 100644 --- a/django_08day11/web/urls.py +++ b/django_08day11/web/urls.py @@ -17,7 +17,7 @@ """ from django.conf.urls import url from django.contrib import admin -from web.views import index,login,list,Add,Delete,Update,Get +from web.views import index,login,list,Add,Delete,Update,Get,AssetList urlpatterns = [ # url(r'^admin/', admin.site.urls), #url 对应- 函数 @@ -30,6 +30,7 @@ url(r'^delete/(?P\d*)/$',Delete), url(r'^update/(?P\d*)/(?P\w*)/$',Update), url(r'^get/(?P\w*)/$',Get), + url(r'^assetlist/$',AssetList), ] diff --git a/django_08day11/web/urls.pyc b/django_08day11/web/urls.pyc index 6ce35d5df19f9633cee93e5405e5ede620177efe..d36a90a8e0bbc8c0f089493f38ecb583c86d55e5 100644 GIT binary patch delta 158 zcmZ3*{fJwd`76nSN**xhS3{kucDf|q<8UmXbS2HoP uPhP|9Hi_i{v!4dv;F^FQRR6Iy2bwz|+!qQpj#xyCJ*@Iva zsh&J&82k&wTmBsJ=G}`Iy^HT{dUS{V_IuyH-}ABcz1{Qvtki$qUmKjj)g$P;4+6~B zdGFBXXOsKl>=VnEg}|RgfJ3t z32=d6JjYcTuPFtt*oT6AH%4~ zUS*ThGOP5`{9?P>u1{*pGpF2L+G6N1tTSx7o4Dt6(Awl8v52ucG8CalM}~^tdf52~U{GwS delta 354 zcmca6+%G82{F#?)*?IA(WCkc;0@4l)Obo?66Qy00SQ%Ov7@{~BQrN%@PKFeAm9pShKd6(}0S4pd>u!3<fp z>``J`K+$55VGN9-9MX)ej2s+(8vK**aAeA}fi!S}2wo5&03t*{gfx)QU;uez@^Vf= OHZdSqfNAmpP7wg|^*fpX From 951847a37586590597e244f9a066bbdd60b81717 Mon Sep 17 00:00:00 2001 From: jiayanhua <402602239@qq.com> Date: Wed, 29 Nov 2017 23:08:01 +0800 Subject: [PATCH 11/11] 20171129 django base over --- .../{web => adminx}/templatetags/__init__.py | 0 .../{web => adminx}/templatetags/tagtest.py | 0 django_08day11/django_08day11/settings.py | 2 +- django_08day11/django_08day11/settings.pyc | Bin 2829 -> 2778 bytes django_08day11/django_08day11/urls.py | 2 +- django_08day11/django_08day11/urls.pyc | Bin 1166 -> 1166 bytes django_08day11/template/assetlist.html | 12 +--- .../assetlist.html => assetlist_bak.html} | 0 django_08day11/template/login.html | 17 ++++++ django_08day11/template/master/layout.html | 8 ++- django_08day11/template/register.html | 19 +++++++ django_08day11/web/forms.py | 13 +++++ django_08day11/web/forms.pyc | Bin 0 -> 549 bytes django_08day11/web/urls.py | 9 ++- django_08day11/web/urls.pyc | Bin 1506 -> 1560 bytes django_08day11/web/views.py | 52 ++++++++++++++++-- django_08day11/web/views.pyc | Bin 2518 -> 3292 bytes 17 files changed, 111 insertions(+), 23 deletions(-) rename django_08day11/{web => adminx}/templatetags/__init__.py (100%) rename django_08day11/{web => adminx}/templatetags/tagtest.py (100%) rename django_08day11/template/{master/assetlist.html => assetlist_bak.html} (100%) create mode 100644 django_08day11/template/login.html create mode 100644 django_08day11/template/register.html create mode 100644 django_08day11/web/forms.py create mode 100644 django_08day11/web/forms.pyc diff --git a/django_08day11/web/templatetags/__init__.py b/django_08day11/adminx/templatetags/__init__.py similarity index 100% rename from django_08day11/web/templatetags/__init__.py rename to django_08day11/adminx/templatetags/__init__.py diff --git a/django_08day11/web/templatetags/tagtest.py b/django_08day11/adminx/templatetags/tagtest.py similarity index 100% rename from django_08day11/web/templatetags/tagtest.py rename to django_08day11/adminx/templatetags/tagtest.py diff --git a/django_08day11/django_08day11/settings.py b/django_08day11/django_08day11/settings.py index cf1e3f1..5df240d 100644 --- a/django_08day11/django_08day11/settings.py +++ b/django_08day11/django_08day11/settings.py @@ -52,7 +52,7 @@ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', + #'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', diff --git a/django_08day11/django_08day11/settings.pyc b/django_08day11/django_08day11/settings.pyc index 750d5138062c89b9ee7adb79151c887d96dbd77e..14b9fc86bdd325c70364729a9bcb85825be7984d 100644 GIT binary patch delta 316 zcmX|+J5Iwu7=*`5Qv16IMr20aw5ld=_Bn zFkC_wf^EDxzn==xg-nkd(jxZyKorLut%{5lkkhC2$#RfH6{exB|mf7@4#4;2P`#WGeH(b#OzP zn_yG01#Sy=z}=B>4{Qnc!2_|?;30S<7sp^*AdWnNvDJwgJB7tWole!+RGk+}ve+7U z0V`j*gsnp|+n}gnQ6td6O8gm(ZtH6NrM`9Eaij8Z&}-jFxzCd4ao3GX>M4Kpn~ri+ I{^8&K0pB@3HUIzs diff --git a/django_08day11/django_08day11/urls.py b/django_08day11/django_08day11/urls.py index 50360d9..95466fb 100644 --- a/django_08day11/django_08day11/urls.py +++ b/django_08day11/django_08day11/urls.py @@ -19,7 +19,7 @@ from django.contrib import admin from django.conf.urls import include -from web.views import index,login,list +from web.views import index,Login,list urlpatterns = [ url(r'^admin/', admin.site.urls), #url diff --git a/django_08day11/django_08day11/urls.pyc b/django_08day11/django_08day11/urls.pyc index f0119990a5c8bada3470e596d577d73f897b6c13..e74cf377d7a341d0b61d7ccf9c8b17b60f25d4ef 100644 GIT binary patch delta 23 ecmeC;l2d`4~~dj>P3&*lPVIYt0afCe=H delta 23 ecmeC;nOHeY-rdj>OO&gKGUIYt0bZ3a{T diff --git a/django_08day11/template/assetlist.html b/django_08day11/template/assetlist.html index 3f8960d..b40d395 100644 --- a/django_08day11/template/assetlist.html +++ b/django_08day11/template/assetlist.html @@ -1,10 +1,5 @@ - - - - - assetlist - - +{% extends "master/layout.html" %} +{% block content %}

{{user}}

{% for item in data %} @@ -28,5 +23,4 @@

jiayanhua

{% else %}

非 jiayanhua

{% endifequal %} - - \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/django_08day11/template/master/assetlist.html b/django_08day11/template/assetlist_bak.html similarity index 100% rename from django_08day11/template/master/assetlist.html rename to django_08day11/template/assetlist_bak.html diff --git a/django_08day11/template/login.html b/django_08day11/template/login.html new file mode 100644 index 0000000..8ef9a11 --- /dev/null +++ b/django_08day11/template/login.html @@ -0,0 +1,17 @@ + + + + + Title + + + + username: +
+ password: + +
+ {{ status }} + + + \ No newline at end of file diff --git a/django_08day11/template/master/layout.html b/django_08day11/template/master/layout.html index a66d6ae..05c9020 100644 --- a/django_08day11/template/master/layout.html +++ b/django_08day11/template/master/layout.html @@ -1,10 +1,14 @@ - + assetlist - +
公用头部
+
+ {% block content %}{% endblock %} +
+
公用底部
\ No newline at end of file diff --git a/django_08day11/template/register.html b/django_08day11/template/register.html new file mode 100644 index 0000000..928f7d3 --- /dev/null +++ b/django_08day11/template/register.html @@ -0,0 +1,19 @@ + + + + + register + + + + + {{form.as_table}} + {{ status }} + + + \ No newline at end of file diff --git a/django_08day11/web/forms.py b/django_08day11/web/forms.py new file mode 100644 index 0000000..06f8998 --- /dev/null +++ b/django_08day11/web/forms.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# @Time : 2017/11/29 12:39 +# @Author : jiayanhua +# @Site : +# @File : forms.py +# @Software: PyCharm Community Edition +from django import forms + +class RegisterForm(forms.Form): + username = forms.CharField() + email = forms.EmailField(required=True,error_messages={'invaild':'格式错误'}) + #ip = forms.GenericIPAddressField() diff --git a/django_08day11/web/forms.pyc b/django_08day11/web/forms.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f75e6f3d3e793cf416e730596eb7bb9ff820bc2 GIT binary patch literal 549 zcmb7AJ5Iwu5S_L2BMOKMK#AOdh>#FM2q92XQY183mR5$H1V?rpcGp1a(9_UR!3}bO zTn7X-2Y{J1f|`~0c|QB*&5ZxK++2HJ4=>^8`1C)bYc>fKeF9Q|Oh70=C=XD;$b*3Z z<-CONi@HmZU$HtRj_H~m0tD7T4@N$h z4J*#BauZnNJ`xi3Sa){@URZ}-Kd2DTHV8Cc7l}q?SGbbaxt19k6AuYk{_SP)x_J0_ ze0rbHEz2h3n>a~Tz+_iJ%5j{bl(tC`DYIM^DY-rJz%CJ-T*bPZV5;2n!k}h?d)~>Y zR+;0D&UArpeB^k*75>0%klWdh@Gj0KDMo4(kB7P3-c#|k-HvYYB63^XnoN7VM{dV( n)tYFD({kb(xh1b`kJG$ZNBEO+)<5*zU\d*)/(?P\d*)/$',list),#P,view,django url(r'^list/(?P\d*)/$', list,{'id':222}), # P,view @@ -31,6 +31,5 @@ url(r'^update/(?P\d*)/(?P\w*)/$',Update), url(r'^get/(?P\w*)/$',Get), url(r'^assetlist/$',AssetList), - - + url(r'^register/$',Register), ] diff --git a/django_08day11/web/urls.pyc b/django_08day11/web/urls.pyc index d36a90a8e0bbc8c0f089493f38ecb583c86d55e5..6984bda722a2808ff265faa7b5671bd3ac74e196 100644 GIT binary patch delta 177 zcmaFFJ%dM@`7NRGbP{VWA43%1#F`3;R3?TL0ftmQhGr&) zbS{P{eufl5hF}e$O^mCVL^y%!OIU$KW?o8a1(@YCc|WrwZwUubFeo)Wv$!O+XcEgu z;bLx}KwJ@2L|?^ELtye3mU5;buE`m!adJ{XSvE!iAar2iVdP=rVH9Ho(ohHhC?g|T delta 126 zcmbQi^N3rT`7-p5-I6p9cSAW!Cb^^I4;1B!Ftz7zKdPiiL-fhlz(# Jj1fqKApm%B7Y+ab diff --git a/django_08day11/web/views.py b/django_08day11/web/views.py index 232f0f3..ad1db5e 100644 --- a/django_08day11/web/views.py +++ b/django_08day11/web/views.py @@ -3,18 +3,60 @@ from django.shortcuts import render from django.http.response import HttpResponse -from web.models import Asset +from web.models import Asset,UserInfo from django.shortcuts import render_to_response +from web.forms import RegisterForm #from django.db.models.manager.Manager import * # Create your views here. -def login(): - return "login" +def Register(request): + registerForm = RegisterForm() + if request.method == 'POST':#如果post提交数据 + form = RegisterForm(request.POST) #将获取数据赋值给form + if form.is_valid():#验证有效性 + data = form.cleaned_data + #data2 = form. + print data + else:#如果无效,返回form错误方法 + #print form.errors.as_json() + #print type(form.errors) + #django.forms.utils.ErrorDict + temp = form.errors.as_data() + print temp['email'][0].messages[0] + #django.core.exceptions.ValidationError temp['email'][0] + #print type(temp['email'][0]) + #print temp.['email'][0]['message'] + #else:#如果普通访问,返回注册页面 + return render_to_response('register.html', {'form':registerForm}) +''' + if request.method == "POST": #跨站请求宝403 + user = request.POST.get('username',None) + pwd = request.POST.get('password',None) + #print user,pwd + result = UserInfo.objects.filter(username=user,password=pwd).count() + if result == 1: + return HttpResponse("login sucess") + else: + return render_to_response('login.html',{'status':'用户名密码错误'}) + else: + return render_to_response('login.html') +''' +def Login(request): + if request.method == "POST": #跨站请求宝403 + user = request.POST.get('username',None) + pwd = request.POST.get('password',None) + #print user,pwd + result = UserInfo.objects.filter(username=user,password=pwd).count() + if result == 1: + return HttpResponse("login sucess") + else: + return render_to_response('login.html',{'status':'用户名密码错误'}) + else: + return render_to_response('login.html') + def index(request):#django 固定格式,接受http请求 return HttpResponse('index') #同上固定格式,返回http -def login(request): - return HttpResponse('login') def list(request,name,id):#传递参数与urls模板一致,多个需要按顺序 print name,id diff --git a/django_08day11/web/views.pyc b/django_08day11/web/views.pyc index 4cbe6341194575cfb11bb4b4e8c76d489f653239..b58b5cc8f4a8dd430106988f173baca3533692cb 100644 GIT binary patch delta 1501 zcmZ`&&2Jk;6n`^ouXpX(agsX4O42xu5Eey6Z~&F65^gJ!s#Smuz4%gXJ(I+)*PHC@ z5)KX)3SSo_swoE~4&2~?lp_bk2?+`Q08SMWhf=u09r51V7`U*j{q39g=6(KVep-0g zTyp-bmjC+UT(<|OkHr7WAi;cdf9dKZ@}TR1Pynh3LkW=&T|ZyDFf2n*-#=-)qSr*QKs>61B4(@-yxkLq}MTCwq zI!!&4ZX2E4812M%Su9W5f;P+`1bVk`Qk}dKCsB{IgR0~Qh;NCBLQQ8fdD1o zo`hsTdeTTZ7H}kCEMef#&g44F1vqkG?7+t6!GIM-7`Pm%0F!Y6l!T^opgAZ3{Wdm7 zn92iHfIgJ~-tE3Bl1SBu)NH8Y!KrQUX>oU^;Nx;|b3i={p9AWDwU( zoN}4yeP#vq0=8414lDA5Cl${q^D`<#uBHu`cDr4{(*8pjjV!~%Hwq)2(PBR|<}gka zGmx1{ZsOI{gelO81~QCy`=gf0dN}l~JXPdOH*op*!I!^&`1PZYKYDcX{^QTz`TfDC zznz?9M7Ti~Gt(xYfG7+ocj_SQ;+3FbZp9-V6mF23HpF)ax|bTJey2agOTkyD7iXh1 zpc|DFPM$%HoJgY1IOzVNvSY7vo*24CML&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