Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Tornado中的静态url调用_Python_Url_Static_Tornado - Fatal编程技术网

Python Tornado中的静态url调用

Python Tornado中的静态url调用,python,url,static,tornado,Python,Url,Static,Tornado,我是Python和Tornado web框架的初学者。当我在研究书“”中的模板部分时,有一行让我感到困惑: <link rel="stylesheet" href="{{ static_url("style.css") }}"> 当没有库导入到名称空间时,应用程序如何知道在何处调用函数static\u url?我在Tornado的web模块中找到了static\u url(),但我不知道如何在该模板文件中成功调用该函数。RequestHandler类有一个方法get\u tem

我是Python和Tornado web框架的初学者。当我在研究书“”中的模板部分时,有一行让我感到困惑:

<link rel="stylesheet" href="{{ static_url("style.css") }}">


当没有库导入到名称空间时,应用程序如何知道在何处调用函数
static\u url
?我在Tornado的web模块中找到了
static\u url()
,但我不知道如何在该模板文件中成功调用该函数。

RequestHandler类有一个方法get\u template\u namespace(),已记录在案。如果单击源链接,您将看到'static\u url'设置为self.static\u url的位置