摘要: 一,模板继承 1.在template下面新建一个master.html的文件,当做母版。 2. 母版里需要被替代的部分,以block开始,以endblock结尾 {% block content %}{% endblock %} 3. 子版里代码 4. 一个HTML中可以有多个block,可能来源不 阅读全文
posted @ 2018-01-24 22:53 cerofang 阅读(161) 评论(0) 推荐(0)
摘要: 1 def index(request): 2 print(type(request)) 3 print(request.environ['HTTP_USER_AGENT'])#字典格式 4 print(request.environ)#字典格式 5 #封装了所有用户请求信息 6 # for k,v 阅读全文
posted @ 2018-01-24 20:01 cerofang 阅读(137) 评论(0) 推荐(0)
摘要: DOM 中对输入文本框的操作,光标靠近时候清楚文本框中内容,当光标移动开后,文本框中内容自动显示 1,( onfocus="Focus();" onblur="Blur();”)捕捉光标的两个js函数; 2. var tag = document.getElementById('i1'); 函数中获 阅读全文
posted @ 2018-01-24 19:50 cerofang 阅读(165) 评论(0) 推荐(0)
摘要: 新建Django工程 1 django-admin.exe startproject mysite 新建static(静态模板文件存储路径) setting中配置static路径 1 STATICFILES_DIRS = ( 2 os.path.join(BASE_DIR,'static'), 3 阅读全文
posted @ 2018-01-11 23:31 cerofang 阅读(134) 评论(0) 推荐(0)
摘要: 选择器 关于选择id 执行过程(console中) 2,class 执行过程 3,标签(组合选择器) 执行代码 执行结果 4, 1 :first 2 V1.0概述 3 获取第一个元素 4 示例 5 描述: 6 获取匹配的第一个元素 7 HTML 代码: 8 <ul> 9 <li>list item 阅读全文
posted @ 2018-01-04 22:59 cerofang 阅读(226) 评论(0) 推荐(0)
摘要: >>>插入图片一个完全覆盖一个有上下左右滚动条 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 </head> 7 <body> 8 <div style= 阅读全文
posted @ 2017-12-25 23:26 cerofang 阅读(134) 评论(0) 推荐(0)
摘要: 》》》基本方法 1 from urllib import request 2 3 response = request.urlopen("https://movie.douban.com/top250?start=25&filter=") 4 content = response.read().de 阅读全文
posted @ 2017-12-22 23:19 cerofang 阅读(229) 评论(0) 推荐(0)
摘要: 下载网址,版本号database version 5.7.20 w10 系统安装过程 安装过程错误部分从登陆进MySQL开始,重置初始密码命令为 参考链接 》》》》》数据库链接实例获取数据库版本号及sql安装自带databases表 1 import MySQLdb 2 def conn_conne 阅读全文
posted @ 2017-12-16 21:12 cerofang 阅读(180) 评论(0) 推荐(0)
摘要: 》》》》》基础rabbitMQ数据交互 1 import pika 2 connection = pika.BlockingConnection( 3 pika.ConnectionParameters('localhost') 4 ) 5 channel = connection.channel( 阅读全文
posted @ 2017-12-13 22:54 cerofang 阅读(185) 评论(0) 推荐(0)
摘要: 》》》》》携程greenlet模块 1 from greenlet import greenlet 2 def test1(): 3 print(15) 4 gr1.switch() 5 print(16) 6 gr1.switch() 7 def test2(): 8 print(25) 9 gr 阅读全文
posted @ 2017-12-13 21:31 cerofang 阅读(276) 评论(0) 推荐(0)