flask后端开发(2):URL与视图

目录

gitcode地址:
https://gitcode.com/qq_43920838/flask_project.git

URL定义

bash 复制代码
from flask import Flask

app=Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello World!'


@app.route('/profile')
def profile():
    return '我是个人中心!'

if __name__ == '__main__':
    app.run(debug=True)

有参url也叫做动态路由

request获取请求参数

URL传参


相关推荐
Lee川4 小时前
LangChain 加持:后端 AI 流式对话的优雅实现
后端
iAm_Ike4 小时前
Go 中自定义类型与基础类型间的显式类型转换详解
jvm·数据库·python
iuvtsrt4 小时前
Golang怎么实现方法集与接口的匹配_Golang如何理解值类型和指针类型实现接口的区别【详解】
jvm·数据库·python
旦莫5 小时前
AI驱动的纯视觉自动化测试:知识库里应该积累什么知识内容
人工智能·python·测试开发·pytest·ai测试
子兮曰6 小时前
Bun v1.3.14 深度解析:Image API、HTTP/3、全局虚拟存储与五十项变革
前端·后端·bun
ltl6 小时前
Self-Attention:让序列自己看自己
后端
楼兰公子6 小时前
buildroot 在编译rust时裁剪平台类型数量的方法
开发语言·后端·rust
知识领航员6 小时前
蘑兔AI音乐深度实测:功能拆解、实测表现与适用场景
java·c语言·c++·人工智能·python·算法·github
吴声子夜歌6 小时前
Go——并发编程
开发语言·后端·golang
释怀°Believe6 小时前
Spring解析
java·后端·spring