摘要:
code import random import string import cherrypy class StringGenerator(object): @cherrypy.expose def index(self): return "Hello world!" @cherrypy.expo 阅读全文
posted @ 2020-12-23 15:47
anobscureretreat
阅读(107)
评论(0)
推荐(0)
摘要:
code import cherrypy class HelloWorld(object): @cherrypy.expose def index(self): return "Hello world!" if __name__ == '__main__': cherrypy.quickstart( 阅读全文
posted @ 2020-12-23 15:46
anobscureretreat
阅读(97)
评论(0)
推荐(0)
摘要:
app.conf [/favicon.ico] tools.staticfile.on: True tools.staticfile.filename: "/path/to/myfavicon.ico" test.py import cherrypy class HelloWorld(object) 阅读全文
posted @ 2020-12-23 15:43
anobscureretreat
阅读(164)
评论(0)
推荐(0)
摘要:
app.conf [/] tools.gzip.on: True [googleapi] key = "..." appid = "..." test.py class Root(object): @cherrypy.expose def index(self): google_appid = ch 阅读全文
posted @ 2020-12-23 15:41
anobscureretreat
阅读(104)
评论(0)
推荐(0)
摘要:
第一种 app.conf [/] tools.gzip.on: True test.py cherrypy.quickstart(myapp, '/', "app.conf") 第二种 class Root(object): @cherrypy.expose @cherrypy.tools.gzip 阅读全文
posted @ 2020-12-23 15:39
anobscureretreat
阅读(234)
评论(0)
推荐(0)
摘要:
code import cherrypy class Band(object): def __init__(self): self.albums = Album() def _cp_dispatch(self, vpath): if len(vpath) == 1: cherrypy.request 阅读全文
posted @ 2020-12-23 15:38
anobscureretreat
阅读(129)
评论(0)
推荐(0)
摘要:
code from flask import Flask, send_from_directory import os cur_dir=os.path.dirname(__file__) app = Flask(__name__) @app.route("/download") def index( 阅读全文
posted @ 2020-12-23 15:28
anobscureretreat
阅读(663)
评论(0)
推荐(1)
摘要:
github地址 https://github.com/.../..../.-/-../ /.--/.../ /-.-./-.-/.../.../..../.-/-../ /.--/.../ /-.-./-.-/.../tree/master 支持的加密方式 https://github.com/. 阅读全文
posted @ 2020-12-23 10:23
anobscureretreat
阅读(946)
评论(0)
推荐(0)
摘要:
安装 sudo apt-get install build-essential 下载 wget https://github.com/jedisct1/libsodium/releases/download/1.0.8/libsodium-1.0.8.tar.gz 解压 tar xf libsodi 阅读全文
posted @ 2020-12-23 09:59
anobscureretreat
阅读(165)
评论(0)
推荐(0)
摘要:
下载地址: https://download.libsodium.org/libsodium/releases/ 支持以下加密方式 salsa20 and chacha20 下载: Wget https://download.libsodium.org/libsodium/releases/libs 阅读全文
posted @ 2020-12-23 09:55
anobscureretreat
阅读(827)
评论(0)
推荐(0)
摘要:
code import paho.mqtt.client as mqtt import time import sys HOST = “1.1.1.1" PORT = 1883 def on_connect(client, userdata, flags, rc): print("Connected 阅读全文
posted @ 2020-12-23 00:42
anobscureretreat
阅读(413)
评论(0)
推荐(0)
摘要:
不转义 var lyric ={{lyrics| safe}}; 阅读全文
posted @ 2020-12-23 00:35
anobscureretreat
阅读(203)
评论(0)
推荐(0)
摘要:
text/html(默认的,html文件) text/plain(纯文本) text/css(css文件) text/javascript(js文件) application/x-www-form-urlencoded(普通的表单提交) multipart/form-data(文件提交) appli 阅读全文
posted @ 2020-12-23 00:33
anobscureretreat
阅读(698)
评论(0)
推荐(0)
摘要:
code #coding=utf-8 from flask import Flask,Response,jsonify,render_template,send_from_directory,make_response from flask_restful import Api, Resource, 阅读全文
posted @ 2020-12-23 00:32
anobscureretreat
阅读(123)
评论(0)
推荐(0)
摘要:
xxx.py:9: DeprecationWarning: The import 'werkzeug.FileStorage' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.datastructures i 阅读全文
posted @ 2020-12-23 00:31
anobscureretreat
阅读(87)
评论(0)
推荐(0)
摘要:
code import werkzeug from flask import Flask import tarfile from flask_restful import Resource, Api, reqparse from werkzeug.datastructures import File 阅读全文
posted @ 2020-12-23 00:30
anobscureretreat
阅读(541)
评论(0)
推荐(0)
摘要:
code from flask import Flask from flask import jsonify import random app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World!' @a 阅读全文
posted @ 2020-12-23 00:29
anobscureretreat
阅读(217)
评论(0)
推荐(0)
摘要:
如果是application/json方式 from flask_restful import request dict = request.json() 如果是application/x-www-form-urlencoded方式 from flask_restful import request 阅读全文
posted @ 2020-12-23 00:28
anobscureretreat
阅读(871)
评论(0)
推荐(0)
摘要:
code @app.route('/‘) def hello_world(): return render_template('index.html’) 阅读全文
posted @ 2020-12-23 00:26
anobscureretreat
阅读(161)
评论(0)
推荐(0)
摘要:
code from flask import Flask,Response from flask_restful import Api, Resource, reqparse import werkzeug app = Flask(__name__) api = Api(app) class Upl 阅读全文
posted @ 2020-12-23 00:25
anobscureretreat
阅读(1554)
评论(0)
推荐(0)
摘要:
code from flask import Flask from flask_restful import Api, Resource, reqparse import werkzeug app = Flask(__name__) api = Api(app) class Uploads(Reso 阅读全文
posted @ 2020-12-23 00:21
anobscureretreat
阅读(445)
评论(0)
推荐(0)
摘要:
code from flask import Flask from flask_restful import Api,Resource app = Flask(__name__) api = Api(app) class HelloWorld(Resource): def get(self): re 阅读全文
posted @ 2020-12-23 00:20
anobscureretreat
阅读(96)
评论(0)
推荐(0)
摘要:
code from flask import Flask from flask_restful import reqparse, abort, Api, Resource app = Flask(__name__) api = Api(app) TODOS = { 'todo1': {'task': 阅读全文
posted @ 2020-12-23 00:17
anobscureretreat
阅读(314)
评论(0)
推荐(0)
摘要:
code Xampp(mysql) Pycharm(vscode) Navicat 阅读全文
posted @ 2020-12-23 00:14
anobscureretreat
阅读(117)
评论(0)
推荐(0)
摘要:
code pip3.7 install flask-wtf 阅读全文
posted @ 2020-12-23 00:12
anobscureretreat
阅读(91)
评论(0)
推荐(0)
摘要:
保证Url唯一性 Demo1 from flask import Flask app = Flask(__name__) @app.route("/hello") def hello(): return "hello world" app.run() 浏览器访问/hello 浏览器访问/hello/ 阅读全文
posted @ 2020-12-23 00:07
anobscureretreat
阅读(55)
评论(0)
推荐(0)
摘要:
新建一个config.py文件,参数必须全部大写 DEBUG=True fisher.py from flask import Flask app = Flask(__name__) app.config.from_object("config") @app.route("/hello") def 阅读全文
posted @ 2020-12-23 00:03
anobscureretreat
阅读(98)
评论(0)
推荐(0)

浙公网安备 33010602011771号