# My WebServer
[![](https://img.shields.io/badge/version-python3.x-green?style=flat-square)](https://www.python.org/downloads/)
[![GitHub last commit](https://img.shields.io/github/stars/RRRoger/MyWebserver-flask.svg?style=flat-square)](https://github.com/RRRoger/MyWebserver-flask)
[![GitHub issues](https://img.shields.io/github/issues/RRRoger/MyWebserver-flask.svg?style=flat-square)](https://github.com/RRRoger/MyWebserver-flask/issues)
[![GitHub last commit](https://img.shields.io/github/last-commit/RRRoger/MyWebserver-flask.svg?style=flat-square)](https://github.com/RRRoger/MyWebserver-flask/commits/master)
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/RRRoger/MyWebserver-flask/blob/master/LICENSE)
> Flask网站模板
>
> python + flask + LayUI + mysql
![](app/static/image/1629711797490.jpg)
![](app/static/image/1629711723519.jpg)
## Technology stack
- Python3.*
- [Flask](https://dormousehole.readthedocs.io/en/latest/)
- Mysql
- [Layui](https://www.layui.com/)
## Features
- 增删改查操作
- 用户管理
- 角色管理
- 权限管理
- 接口日志
- 搜索、分页
- 异常捕获
## Init
- 添加环境变量
```bash
export FLASK_APP=hello.py
```
- 创建数据库
```bash
# 进入数据库
mysql -uroot -p
# 创建爱你数据库
create database test_db charset=utf8;
```
- 初始化数据库
```bash
flask db init
# 第一次先删除`migrations`目录
rm -rf migrations
flask db migrate
# 修改数据库结构
flask db upgrade
```
- 初始化用户数据
```bash
# 初始化用户数据
flask init-tables
```
## Run
### 1. 普通启动方式
```bash
python hello.py
```
### 2. with gunicorn
- 安装`gunicorn` & `gevent`
```bash
pip install gunicorn
pip install gevent
```
- 使用`gunicorn`启动服务
```bash
cd MyWebserver-flask
gunicorn -c gunicorn.conf.py hello:app --preload -b 0.0.0.0:5000
# 后台启动
gunicorn -c gunicorn.conf.py hello:app --preload -b 0.0.0.0:5000 --daemon
```
## 如何关闭进程?
- `ps -ef|grep gunicorn`
```bash
roger 12434 1 0 15:15 ? 00:00:02 ...... -b 0.0.0.0:5000 --daemon
roger 12442 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12443 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12444 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12445 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12446 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12447 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12448 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12449 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
roger 12450 12434 0 15:15 ? 00:00:01 ...... -b 0.0.0.0:5000 --daemon
```
- 删除父进程
```bash
kill -9 12434
```
## 查看日志
```bash
# 访问日志
tail -f ~/log/gunicorn_access.log
# 接口日志
tail -f ~/log/gunicorn_info.log
```
没有合适的资源?快使用搜索试试~ 我知道了~
python + flask + LayUI + mysql 网站模板(毕业设计)
共233个文件
gif:75个
py:58个
js:36个
需积分: 25 7 下载量 45 浏览量
2023-01-24
17:56:59
上传
评论
收藏 1.29MB ZIP 举报
温馨提示
超级简约的网站模板
资源推荐
资源详情
资源评论
收起资源包目录
python + flask + LayUI + mysql 网站模板(毕业设计) (233个子文件)
bootstrap.min.css 138KB
layui.css 73KB
layer.css 14KB
login.css 11KB
layui.mobile.css 10KB
bootstrap-table.min.css 8KB
laydate.css 7KB
styles.css 2KB
code.css 1KB
iconfont.eot 46KB
59.gif 10KB
22.gif 10KB
24.gif 8KB
13.gif 7KB
16.gif 7KB
39.gif 6KB
64.gif 6KB
63.gif 6KB
50.gif 6KB
loading-0.gif 6KB
4.gif 6KB
1.gif 5KB
42.gif 5KB
71.gif 5KB
21.gif 5KB
20.gif 5KB
29.gif 5KB
70.gif 4KB
5.gif 4KB
17.gif 4KB
27.gif 4KB
9.gif 4KB
44.gif 4KB
11.gif 4KB
8.gif 4KB
3.gif 4KB
23.gif 4KB
34.gif 4KB
41.gif 4KB
38.gif 4KB
65.gif 3KB
32.gif 3KB
45.gif 3KB
7.gif 3KB
12.gif 3KB
26.gif 3KB
60.gif 3KB
2.gif 3KB
40.gif 3KB
25.gif 3KB
19.gif 3KB
66.gif 3KB
18.gif 3KB
46.gif 3KB
10.gif 3KB
28.gif 3KB
51.gif 3KB
57.gif 3KB
67.gif 3KB
0.gif 3KB
48.gif 3KB
43.gif 3KB
30.gif 2KB
61.gif 2KB
33.gif 2KB
69.gif 2KB
14.gif 2KB
47.gif 2KB
36.gif 2KB
49.gif 2KB
58.gif 2KB
6.gif 2KB
54.gif 2KB
53.gif 2KB
56.gif 2KB
62.gif 2KB
31.gif 2KB
55.gif 2KB
35.gif 2KB
15.gif 2KB
loading-2.gif 2KB
37.gif 1KB
68.gif 1KB
52.gif 777B
loading-1.gif 701B
.gitignore 398B
hs_user_tree.html 6KB
hs_model_tree.html 6KB
hs_bilibili_bv_tree.html 6KB
hs_role_tree.html 6KB
base.html 6KB
hs_api_log_tree.html 6KB
hs_api_log_form.html 5KB
test_layui.html 4KB
hs_user_form.html 3KB
hs_user_reset_password_form.html 3KB
hs_model_form.html 3KB
base-user.html 3KB
test.html 3KB
hs_bilibili_bv_form.html 3KB
共 233 条
- 1
- 2
- 3
资源评论
suli77
- 粉丝: 8014
- 资源: 67
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于thinkphp5/weui/layui的简易投票系统,适用于社团/班级投票选举
- 基于Spring +mybatis的投票系统 支持单选多选,统计信息等
- 基于pandas、Scikit-Learn、matplotlib、PyQt5的二手房价分析与预测系统
- 基于 yolov5 和 PyQt5 开发工具搭建了实时违法检测区域入侵软件,支持自定义检测区域、多种对象检测以及事件信息统计
- ZG202220101014胡雪梅.zip
- 姥娘家菜单修改最新再做500张.cdr
- 基于Python实现的英雄联盟知识图谱的问答
- 密码学算法之SHA-1
- 基于Python实现联邦学习框架下基于Memae的异常检测架构
- 密码学之DES加密算法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功