python - 如何知道 cherrypy 中的原始 url?

标签 python cherrypy

你如何在 cherrypy 中获取 baseurl?我看到一个 cherrypy.url() 给了我整个 url "http://mywebaddress.com/currentpage"

在 cherrypy 中是否有一些类似的功能可以让我无论我在哪条路线上都可以获得“http://mywebaddress.com”/“http://mywebaddress.com/”部分?

最佳答案

cherrypy.request 对象有 basescript_name属性。

关于python - 如何知道 cherrypy 中的原始 url?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14076780/

相关文章:

python - 使用 pandas 修复错误年份(y2k bug)的简单方法

python - 如何在使用 token 后强制使其过期(在使用 python 中的 itsdangerous 库为 token 设置过期时间之前)

python - 在 Ubuntu 上用 python 导入一个 dll

python - 有没有办法使用 numpy 的数组索引对列执行多重检查?

python - CherryPy WebService 不将 NLTK 搭配返回到浏览器窗口

python - 当调用相同的端点时,带有 CherryPy 的 Bottle 不会表现为多线程

CherryPy 服务器错误日志

python - CherryPy配置tools.staticdir.root问题

python - Python 代码 AttributeError : 'NoneType' object has no attribute 'title' 问题

python - 根据单元格类型展开 pandas 列