def url_for(endpoint, **values): """Generates a URL to the given endpoint with the method provided. 为一个给出的带有方法的endpoint生成一个url :param endpoint: the endpoint of the URL (name of the function) endpoint: 就是视图函数的名字 :param values: the variable arguments of the URL rule values: 不同参数(字典) """ return _request_ctx_stack.top.url_adapter.build(endpoint, values) 待解决难点:栈
url用法示例
url_for(‘static‘, filename=‘favicon.ico‘)
时间: 2024-11-01 18:01:13