myflask
==============
flask快速启动项目,包含
- 基础用户登陆注册
- Swagger文档支持
- GraphQL支持(Relay)
- 阿里云SDK
- 图片缩放服务
- .env支持
## 运行
```
开发环境
python -m venv ./venv
. ./venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# 修改.env为合适的值
export FLASK_APP="myflask"
export FLASK_CONFIG=development
flask run
curl http://127.0.0.1:5000/hello
```
## Swagger
浏览器打开 http://127.0.0.1:5000/apidocs
## GraphQL
浏览器打开 http://127.0.0.1:5000/graphql
支持Relay
```
# 用户筛选
query {
userList(page: 1, pageSize: 2) {
edges {
node {
id,
username
}
}
}
}
# 创建用户
mutation test {
createUser(email: "test3@qq.com", username:"test3", password: "password") {
ok,
code,
message
}
}
```
## 文件缩放服务
支持对图片缩放,通过w指定宽度
浏览器打开 http://127.0.0.1:5000/file/image/1.jpg?w=100
## 阿里云SDK
代码路径 app/utils/aliyun.py
目前包含短信发送
## 正式环境部署
```
supervisor配置参考supervisor/myflask.conf.example
```
没有合适的资源?快使用搜索试试~ 我知道了~
最小化flask快速启动项目,包含基础用户登陆注册,支持graphql,swagger.zip
共35个文件
py:24个
txt:3个
example:2个
需积分: 5 0 下载量 158 浏览量
2023-09-28
12:39:16
上传
评论
收藏 101KB ZIP 举报
温馨提示
最小化flask快速启动项目,包含基础用户登陆注册,支持graphql,swagger
资源推荐
资源详情
资源评论
收起资源包目录
最小化flask快速启动项目,包含基础用户登陆注册,支持graphql,swagger.zip (35个子文件)
myflask-master
supervisor
myflask.conf.example 326B
file
image
1.jpg 78KB
setup.py 266B
.env.example 242B
app
__init__.py 3KB
controllers
file.py 946B
auth.py 5KB
utils
common.py 138B
auth.py 1KB
aliyun.py 1KB
templates
email
reset_password.html 420B
confirm.html 463B
confirm.txt 252B
reset_password.txt 302B
docs
common.py 402B
auth.py 3KB
schema
__init__.py 369B
mutation.py 1KB
fields.py 3KB
query.py 917B
types.py 1KB
filters.py 168B
models
auth.py 4KB
handlers.py 3KB
errors.py 483B
email.py 679B
scripts
database.py 523B
myflask.py 112B
tests
__init__.py 16B
test_auth.py 4KB
requirements.txt 436B
logs
.gitkeep 0B
.gitignore 2KB
README.md 1KB
config.py 4KB
共 35 条
- 1
资源评论
天天501
- 粉丝: 604
- 资源: 4666
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功