V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  noobsheldon  ›  全部回复第 14 页 / 共 14 页
回复总数  266
1 ... 5  6  7  8  9  10  11  12  13  14  
2016 年 12 月 21 日
回复了 herozem 创建的主题 Flask flask 中的 endpoint 的存在的意义是什么?
endpoint 的值是唯一的,同一模块中可以有同名的 view function (视图函数)。对于 url_for 函数的参数,如果使用函数名作为参数,则无法确定其 url ;使用 endpoint 作为参数,则保证了 url_for 返回确定的 url 。

<code>

# encoding: utf-8
from flask import Flask

app=Flask(__name__)

@app.route('/',endpoint="good")
def index():
return "Good jod"

@app.route('/<int:id>',endpoint="bad")
def index(id):
return "%s"%id

if __name__ == "__main__":
app.run()
</code>
2016 年 12 月 17 日
回复了 ansheng 创建的主题 程序员 过年回家,好多东西好快递回去,选哪个?
搬家公司
2016 年 12 月 10 日
回复了 freaks 创建的主题 Linux 计算机术语中 on the fly 如何翻译比较得当
在运行过程中对 PATH 和任意环境变量的修改都不是永久的,永久性的修改应该在.bashrc 文件中完成。
这样翻,不知行不行。
@zzandlove 你是什么系统啊
2016 年 11 月 24 日
回复了 redsonic 创建的主题 宽带症候群 电信(非 CN2)回光反照了?
linode 美西的 100M 文件下载,能达到最低 300 多 K(20M 电信)
1 ... 5  6  7  8  9  10  11  12  13  14  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2706 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 10:24 · PVG 18:24 · LAX 03:24 · JFK 06:24
♥ Do have faith in what you're doing.