项目场景:
项目场景:flask蓝图在区分不同路径是出现BUG
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
解决方案:
当你在flask蓝图定义***url_prefix***了的时候,一定要跟着你的路径走,启动服务,只启动到根目录,你需要添加
蓝图:
user_bp1 = Blueprint('user',__name__,url_prefix='/user')
路径是http://127.0.0.1:5000/
后面必须加上user
所以结果是http://127.0.0.1:5000/user
OK,成功