文件服务目录(相对目录),一般为 ‘.’(webapp的目录从属关系)。一般的webapp都使用 “docroot” 或者类似的名称,并将所有文件放到docroot/ 的子目录中。这是比较安全的,因为外部不能访问此目录中的文件,所以您可以比较放心得将您的代码或者是数据存放到此目录中。
assetLocation The (relative or absolute) url location where static assets are to be found. If you use a relative location ("static/img/" for instance), the assets are located inside the webapp's docroot (use "." to use the docroot directory itself, instead of a directory inside it). If you use an absolute location ("/static/" for instance), the assets are located in another web app or path entirely (but still on the same web server). It is also possible to put a totally different url here such as "http://images.server.com/img/" to be able to serve static assets (images, files) from an entirely different server. This setting is used by the asset Ypage function and the mkAssetUrl Webapp function.
可以访问到静态文件的url路径(相对 或 绝对)。如果您使用相对路径(比如 “static/img/”),所有文件都被放置到 webapp的docroot中(可以通过 ‘.’来使用docroot目录)。如果使用绝对路径(”/static/”),所有文件将被放到其他的 web app或者路径中(但是仍然使用同一个 web server)。也可以将文件(图片,文件)放到完全不同web server的url中,比如 http://images.server.com/img/ 。设置此项可以通过 asset Ypage函数 和 mkAssetUrl Webapp函数。
snakelets a dict that maps (relative) URL patterns to snakelet classes. With this you define the snakelets in your web application, and on what URLs they are 'listening'. Don't forget to import the required modules/classes. You can use 'fnmatch'-style patterns here, for instance: docs/*.pdf would let the snakelet listen on any URL that matches this pattern, such as http://.../docs/report.pdf (the full URL must match the pattern). If you don't use a pattern, any URL that starts with the string matches. Note that if you use fnmatch-patterns, you cannot use path info arguments anymore (only query args): http://.../docs/report.pdf/path/info?foo=bar doesn't work, but http://.../docs/report.pdf?foo=bar still does. See below how you can use Snakelets as virtual index pages.
上一页 1 2 3 4 5 6 7 8 910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 下一页
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个 |
注册
个人空间
