centos7 安装
我们使用的是Oracle VM VirtualBox来新建centos虚拟机
python 虚拟环境操作命令
whith python 查看位置
mount -t vboxsf 共享文件夹的名字 /home/www
source bin/activate 启动虚拟环境
service mysqld start 启用数据库
systemctl stop firewalld.service 停止防火墙
/etc/yum.repos.d
rpm -ivh 安装
/etc/yum.repos.d/ yum的镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
export ops_config=loal&&python manager.py runserver
netstat -tlnp|grep 8999 通过端口监听
kill -9 PID 进程号
版本出错 SQLAlchemy==1.3.22
Mysql命令
CREATE DATABASE `food_db` DEFAULT CHARACTER SET = `utf8mb4`; 创建数据库
show databases; 查看数据库
use 数据库 使用数据库
flush privileges 刷新数据库权限
xshell 连接命令
SSH @用户名 地址
flask 快速入门
mysql安装
flaske 日志系统
在Debug 为true时候才能用下面两个模式
打开的方法 在app.run里加入debug=True
app.logger.debug(‘A value for debugging’)
app.logger.warning(‘A warning occurred (%d apples)’, 42)
一般用error模式
app.logger.error(‘An error occurred’)