Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/295.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 CherryPy是否有url_的替代方案?_Python_Flask_Cherrypy - Fatal编程技术网

Python CherryPy是否有url_的替代方案?

Python CherryPy是否有url_的替代方案?,python,flask,cherrypy,Python,Flask,Cherrypy,Flask有一个用于方法调用的url_,用于从其全局设置文件夹设置url 我如何管理与CherryPy类似的东西?这就是你想要的吗 您可以通过访问装载的url处理程序 cherrypy.tree.apps[mount_point].root root始终是装载点的装载实例。因此,反向函数看起来像: def reverse(cls): # get link to a class type for app_url in cherrypy.tree.apps.keys():

Flask有一个用于方法调用的url_,用于从其全局设置文件夹设置url


我如何管理与CherryPy类似的东西?

这就是你想要的吗

您可以通过访问装载的url处理程序

cherrypy.tree.apps[mount_point].root
root始终是装载点的装载实例。因此,反向函数看起来像:

def reverse(cls):
    # get link to a class type
    for app_url in cherrypy.tree.apps.keys():
        if isinstance(cherrypy.tree.apps[app_url].root, cls):
            # NOTE: it will return with the first mount point of this class
            return app_url

希望这有帮助

如果你使用,你有它的url\u