前言
Flask-RESTful 结合蓝图使用设计接口
RESTful 接口
没使用蓝图之前 注册接口
from apps import create_app, db, jwt
from flask import...url_for, request, jsonify
from flask_restful import reqparse, abort, Api, Resource
from apps.models...├── test_auth.py
│ └── test_blog.py
│ └── test_pay.py
├── venv/
├── app.py
那么可以在auth.py 写注册相关的接口...from flask_restful import Api, reqparse, abort, Api, Resource
bp = Blueprint('auth', __name__, url_prefix...{
"username": "test",
"password" : "123456"
}
接口返回
HTTP/1.1 200 OK
Server: Werkzeug/2.2.2 Python