基于nginx一键部署https

Centos7环境下全自动创建kvm虚拟机

Sqlalchemy

#!/usr/bin/env python# -*- coding: utf-8 -*-# @Time : 2019/4/3 14:48# @Author : Ropon# @File : sqlalchemy.py# 导入官宣基础模型from sqlalchemy.ext.declarative import declarative_base# 实例化...

Flask Ipv6检测小例子

#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/4/15 14:38 # @Author : Ropon # @File : ws_demo.py from flask import Flask, request, render_template from geventwebsocket.handle...

Dbutils 连接池

#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/4/10 13:27 # @Author : Ropon # @File : dbpool.py import pymysql from DBUtils.PooledDB import PooledDB POOL = PooledDB( cre...

wtforms 基本使用

from flask import Flask, request, render_template from wtforms.fields import simple, core from wtforms import validators from wtforms import Form app = Flask(__name__) class LoginForm(Form): ...

Flask 上传文件小例子

from flask import Flask, views, request, jsonify app = Flask(__name__) pkey = 'xxxxxx' host = '127.0.0.1' port = 9080 data = {'code': 200, 'msg': None} # use: # curl -F "rfile=@d:\12.txt" -F "uk...

Flask 路由及蓝图

# 路由 # methods 配置请求允许方式 是复数也就是一个可迭代对象 ["GET", "POST"] # endpoint 反向解析url地址的标志 默认是视图函数名 url_for()解析 # defaults 配置视图函数的默认参数值 defaults={"page": "...

Flask 模板及session

总结 {#{{ }}#} 引入变量 Jinjia2模板语法字典取值操作与python操作字典相似,多个句点. 遍历负载数据结构 {#{% %}#} 引入逻辑代码 |safe 或Markup 标识标签安全,取消转义 后端定义函数,传入模板 {#{{ addfuc...

Flask Response及Request

from flask import Flask, render_template, redirect, jsonify, send_file, request app = Flask(__name__) @app.route('/') def hello_world(): # return 'Flask Hello' return redirect("/login")...

shell 变量

# 定义普通变量 只能由字母、数字、下划线组成,只能以字母或下划线开头 web_path=/home/wwwroot web_path='/home/wwwroot' web_path="/home/wwwroot" web_path=$(pwd) # 命令执行结果赋给变量 # awk输出 ...

Centos批量绑定IPV6地址

#!/bin/bash # Author: Ropon # Blog: https://www.ropon.top eth0f="/etc/sysconfig/network-scripts/ifcfg-eth0" resf="/etc/resolv.conf" ipv6="" ipgw="" restartflag=0 Help() { echo "Usage: ./$(basen...