阅 读 文 章

snakelets 文档,我翻译了一部分。

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(瘦青蛙) | 时间:2007-05-27 | 浏览:人次 ]


您可能定义这个函数用来初始化您的webapp。参数值为当前的得webapp。 注意:如果您正在使用多重vhost 进行开发,init函数将在每一个vhost中被执行一次!请注意这一点,尤其是当您正在使用 system-global(系统全局)初始化代码的时候,比如注册系统插件…(您应该捕捉可能出现的错误,或者添加一些代码来确定这些注册操作只进行一次)。

def close(webapp): ... You may define this function to do your webapp's cleanup when it is removed. Parameter is the current webapp. Note: when you are deploying your webapp on multiple vhosts, the init is called once for each vhost! 
当您的webapp被移除的时候自动执行此函数。参数是当前的webapp。 
[/list]


vhost config: To make your web application appear on the server, you have to add it to the virtual host configuration file. See Starting the Server.
vhost 配置:如果想在server中运行您的webapp,您需要在虚拟主机中添加相应的配置文件。见Starting the Server。

Python module/package names: There is a big catch concerning the naming of your packages and modules in the web apps (for instance, the package where your snakelets are in, or the name(s) of the modules that contain your snakelets). They are not unique over all web applications (because every webapp's directory is placed in Python's module search path)! This means that you cannot have a module or package called "snakelets" in one webapp and also a module or package with that name in another web application. This also means that your code is not protected from (ab)use by another web application. This wil very likely not be fixed, so keep this in mind!
Python module/package 名称:您的 package 和 module 的名称在整个web应用程序中并不是唯一的(因为所有的webapp目录都在搜索路径范围之内)!这就意味着您不能有名为 “snakelets”的webapp,当然在其他web应用程序中的module或 package也不能用这个名字。也就是说使用同名的module/package您想要使用的module/package将不能保证在其他web应用程序中被运行。

Shared modules/libraries: place modules and packages that you want to easily share between webapps in the "userlibs" directory, as described in Starting and Configuring. 
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个

最新评论 共有1位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.