您可能定义这个函数用来初始化您的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.
上一页 1 2 3 4 5 6 7 8 9 10 11 12 1314 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 一个 |
注册
个人空间
