上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 68 下一页
摘要: Nginx(engine x)是一个高性能的HTTP和反向代理服务器,也是 一个IMAP/POP3/SMTP服务器,工作 在OSI七层,负载的实现方式:轮询,IP_HASH,fair,session_sticky. Apache HTTP Server是一个模块化的服务器,源于NCSAhttpd服务 阅读全文
posted @ 2020-08-31 22:31 anobscureretreat 阅读(370) 评论(0) 推荐(0) 编辑
摘要: 一般是用户通过浏览器向我们的服务器发起一个请求(request),这个请求会去访问视图函数,如果不涉 及到数据调用,那么这个时候视图函数返回一个模板也就是一个网页给用户) 视图函数调用模型毛模型去数据库查找数据,然后逐级返回,视图函数把返回的数据填充到模板中空格 中,最后返回网页给用户。 1.wsg 阅读全文
posted @ 2020-08-31 22:28 anobscureretreat 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 为什么要使用会话管理 众所周知,HTTP协议是一个无状态的协议,也就是说每个请求都是一个独立的请求,请求与请求之间 并无关系。但在实际的应用场景,这种方式并不能满足我们的需求。举个大家都喜欢用的例子,把商品 加入购物车,单独考虑这个请求,服务端并不知道这个商品是谁的,应该加入谁的购物车?因此这个请 阅读全文
posted @ 2020-08-31 22:23 anobscureretreat 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 什么是CORS? CORS是一个W3C标准,全称是“跨域资源共享"(Cross-origin resoure sharing). 它允许浏览器向跨源服务器,发出XMLHttpRequest请求,从而客服了A JAX只能同源使用的限制。 什么是CSRF? CSRF主流防御方式是在后端生成表单的时候生成 阅读全文
posted @ 2020-08-31 22:17 anobscureretreat 阅读(589) 评论(0) 推荐(0) 编辑
摘要: 1、 Django走的大而全的方向,开发效率高。它的MTV框架,自带的ORM,admin后台管理,自带的 sqlite数据库和开发测试用的服务器,给开发者提高了超高的开发效率。 重量级web框架,功能齐全,提供一站式解决的思路,能让开发者不用在选择上花费大量时间。 自带ORM和模板引擎,支持jinj 阅读全文
posted @ 2020-08-31 22:09 anobscureretreat 阅读(874) 评论(0) 推荐(0) 编辑
摘要: WSGI: web服务器网关接口,是一套协议。用于接收用户请求并将请求进行初次封装,然后将请求交给web框 架。 实现wsgi协议的模块:wsgiref,本质上就是编写一socket服务端,用于接收用户请求(django) werkzeug,本质上就是编写一个socket服务端,用于接收用户请求(f 阅读全文
posted @ 2020-08-31 22:08 anobscureretreat 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 在django中,路由是浏览器访问服务器时,先访问的项目中的url,再由项目中的url找到应用中url, 这些url是放在一个列表里,遵从从前往后匹配的规则。 在flask中,路由是通过装饰器给每个视图函数 提供的,而且根据请求方式的不同可以一个url用于不同的作用。 阅读全文
posted @ 2020-08-31 22:06 anobscureretreat 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 浏览器发送的请求被Nginx监听到,Nginx根据请求的URL的PATH或者后缀把请求静态资源的分发到静 态资源的目录,别的请求根据配置好的转发到相应端口。 实现了WSGI的程序会监听某个端口,监听到Nginx转发过来的请求接收后(一般用socket的recv来接收 HTTP的报文)以后把请求的报文 阅读全文
posted @ 2020-08-31 22:03 anobscureretreat 阅读(240) 评论(0) 推荐(0) 编辑
摘要: qq群:1143033906 欢迎加入。 阅读全文
posted @ 2020-08-24 11:21 anobscureretreat 阅读(243) 评论(0) 推荐(0) 编辑
摘要: qq群:864902439 欢迎加入讨论。 阅读全文
posted @ 2020-08-24 11:19 anobscureretreat 阅读(498) 评论(0) 推荐(0) 编辑
摘要: code1 class mytest(): def __str__(self): return "hello" def __repr__(self): return "world" a=mytest() print(a) print(str(a)) print(repr(a)) outputs he 阅读全文
posted @ 2020-08-23 23:55 anobscureretreat 阅读(125) 评论(0) 推荐(0) 编辑
摘要: code import time #—————————————————————————————————————————————— #死循环打印1 ''' def count_n1(): return 1 for i in iter(count_n1, 6): print(i) ''' #—————— 阅读全文
posted @ 2020-08-23 23:39 anobscureretreat 阅读(3839) 评论(0) 推荐(0) 编辑
摘要: code >>> import django >>> django.version Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'django' has n 阅读全文
posted @ 2020-08-23 11:11 anobscureretreat 阅读(212) 评论(0) 推荐(0) 编辑
摘要: code 1.每个缩进层级使用4个空格。 2.每行最多79个字符。 3.顶层的函数(def)或类(class)的定义之间空两行。 4.采用ASCII或UTF-8编码文件。(就是在里面表明编码格式,ASCII编码格式或者是UTF-8的编码格式) 5.在文件的顶端,注释和文档说明之下,每行每条impor 阅读全文
posted @ 2020-08-23 11:06 anobscureretreat 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 在python中的random.randint(a,b)用于生成一个指定范围内的整数zd。 其中参数专a是下限,参数b是上限,生成的随机数n: a <= n <= b。 所以random.randint(9,10)的意思是: 生成大于等于9,小于等于10的随机整数。 因此这句得到的结果不是9,就是1 阅读全文
posted @ 2020-08-23 11:05 anobscureretreat 阅读(845) 评论(0) 推荐(0) 编辑
摘要: code macname@MacdeMBP Desktop % python3 test.py /Users/macname/Desktop/test.py /Users/macname/Desktop macname@MacdeMBP Desktop % cat test.py #coding=u 阅读全文
posted @ 2020-08-23 11:04 anobscureretreat 阅读(942) 评论(0) 推荐(0) 编辑
摘要: 下载驱动后,解压 然后将可执行文件放在/usr/local/bin/下面 在命令输入chromedriver后出现以下内容,表示配置成功 macname@MacdeMacBook-Pro ui_web_automation % chromedriver Starting ChromeDriver 8 阅读全文
posted @ 2020-08-23 11:02 anobscureretreat 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 安装 pip3.7 install pyperclip code import pyperclip pyperclip.copy('hello world') print(pyperclip.paste()) output Python 3.7.4 (v3.7.4:e09359112e, Jul 8 阅读全文
posted @ 2020-08-23 11:00 anobscureretreat 阅读(1077) 评论(0) 推荐(0) 编辑
摘要: code import logging logger = logging.getLogger(__name__) logger.setLevel(level = logging.INFO) handler = logging.FileHandler("log.txt") handler.setLev 阅读全文
posted @ 2020-08-23 10:57 anobscureretreat 阅读(127) 评论(0) 推荐(0) 编辑
摘要: code macname@MacdeMacBook-Pro new % python3 Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:54:52) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", 阅读全文
posted @ 2020-08-23 10:56 anobscureretreat 阅读(813) 评论(0) 推荐(0) 编辑
摘要: code >>> a="192.168.0.5:5000" >>> f'http://{a}/chain' 'http://192.168.0.5:5000/chain' 阅读全文
posted @ 2020-08-23 10:54 anobscureretreat 阅读(674) 评论(0) 推荐(0) 编辑
摘要: pip安装 Pip3.7 install notebook 启动Jupyter jupyter notebook 安装voila pip3.7 install voila 阅读全文
posted @ 2020-08-23 10:51 anobscureretreat 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 链接:https://pan.baidu.com/s/1isjLEUPZpkz0F3c45a59KA 密码:bueu 如果失效,点这里 阅读全文
posted @ 2020-08-22 23:19 anobscureretreat 阅读(764) 评论(0) 推荐(0) 编辑
摘要: 链接:https://pan.baidu.com/s/1rqosW7NUV9S5MmWgzB_cFw 密码:njx8 如果失效,点这里 阅读全文
posted @ 2020-08-22 23:12 anobscureretreat 阅读(1428) 评论(0) 推荐(2) 编辑
摘要: 链接:https://pan.baidu.com/s/1fWe4Y4wBXIS2-YZbLuYLuA 密码:jqbb 如果失效,点这里 阅读全文
posted @ 2020-08-22 23:04 anobscureretreat 阅读(1868) 评论(0) 推荐(1) 编辑
摘要: code import os cur=os.path.dirname(os.path.abspath(__file__)) print(cur) b=os.path.dirname(cur) print(b) dir=os.path.join(os.path.dirname(os.path.dirn 阅读全文
posted @ 2020-08-19 18:02 anobscureretreat 阅读(339) 评论(0) 推荐(0) 编辑
摘要: code import os import shutil shutil.move(u'F:\\learn_py\\testdata\\PPT蒙板.docx','F:\\learn_py') 阅读全文
posted @ 2020-08-19 18:00 anobscureretreat 阅读(213) 评论(0) 推荐(0) 编辑
摘要: code if __name__ == '__main__': app.run(host="0.0.0.0", port=5000) #app.run(debug=True) 阅读全文
posted @ 2020-08-19 17:57 anobscureretreat 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1.只接受本机的访问,192.168.1.3是本机IP from flask import Flask app = Flask(__name__) @app.route("/hello") def hello(): return "hello world" app.run(host="192.168 阅读全文
posted @ 2020-08-19 17:56 anobscureretreat 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 206状态码, 大概就是浏览器先不下载要下载的文件,而是弹窗告诉用户,该文件是什么,有多大。由用户自行决定是否下载。 在html中,加一个a标签,a标签的地址是一个文件,就可实现该效果。 具体可参考下面解释: HTTP/206响应 最后一条会话返回了HTTP/206 “Partial Content 阅读全文
posted @ 2020-08-19 17:50 anobscureretreat 阅读(2429) 评论(0) 推荐(0) 编辑
摘要: code 1.将string转成json var json={}; var myorderno=$("#myorderno").val(); json.myorderno=myorderno; var jsontext=JSON.stringify(json); 2.将json转成string va 阅读全文
posted @ 2020-08-19 17:48 anobscureretreat 阅读(1461) 评论(0) 推荐(0) 编辑
摘要: 图片 code <html> <head> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <style> /*修改提示框*/ #mytitle { position: absolute; color: #ffffff; 阅读全文
posted @ 2020-08-19 17:46 anobscureretreat 阅读(353) 评论(0) 推荐(0) 编辑
摘要: code <script type="text/javascript"> $(document).ready(function () { if (window.history && window.history.pushState) { $(window).on('popstate', functi 阅读全文
posted @ 2020-08-19 17:39 anobscureretreat 阅读(166) 评论(0) 推荐(0) 编辑
摘要: code <input type=button value=刷新 οnclick="window.location.reload()"> <input type=button value=前进 οnclick="window.history.go(1)"> <input type=button va 阅读全文
posted @ 2020-08-19 17:38 anobscureretreat 阅读(338) 评论(0) 推荐(0) 编辑
摘要: code <a id="baidu_link" href ="www.baidu.com" title="百度"/> <script type="text/javascript"> function setTitle() { document.getElementById( "baidu_link" 阅读全文
posted @ 2020-08-19 17:36 anobscureretreat 阅读(259) 评论(0) 推荐(0) 编辑
摘要: WPO(Web Performance Optimization,Web 性能优化) 什么是延迟? 分组从信息源发送到目的地所需的时间。 什么是带宽? 逻辑或物理通信路径最大的吞吐量。 性能提升的意义,小案例: 为减少跨大西洋的延迟而铺设 Hibernia Express 专线 在金融市场上,很多常 阅读全文
posted @ 2020-08-19 17:32 anobscureretreat 阅读(246) 评论(0) 推荐(0) 编辑
摘要: code if (!/^[1-9]\d?$/g.test(num)){ alert('必须是1-99之间的数字'); return false; } function isCardNo(card) { var reg = /^[1-9]\d?$/; if(reg.test(card) false) 阅读全文
posted @ 2020-08-19 17:31 anobscureretreat 阅读(1148) 评论(0) 推荐(0) 编辑
摘要: code <html> <body> <input onkeydown="if(event.keyCode==13) {test()}"/> <script> function test() { alert(123); } </script> </body> </html> 阅读全文
posted @ 2020-08-19 17:30 anobscureretreat 阅读(1211) 评论(0) 推荐(0) 编辑
摘要: code 对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari: * window.innerHeight 高度 * window.innerWidth 宽度 对于 Internet Explorer 8、7、6、5: * document.docum 阅读全文
posted @ 2020-08-19 17:28 anobscureretreat 阅读(453) 评论(0) 推荐(0) 编辑
摘要: code $('.go-btn').click(function() { window.open( $('#my-dropdown').val(), "_newtab" ); }); code $('.go-btn').click(function() { window.open( $('#my-d 阅读全文
posted @ 2020-08-19 17:26 anobscureretreat 阅读(443) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 68 下一页