开发者

Web2py Import Once per Session

I'm using 开发者_StackOverflow社区Web2Py and i want to import my program simply once per session... not everytime the page is loaded. is this possible ? such as "import Client" being used on the page but only import it once per session..


In web2py your models and controllers are executed, not imported. They are executed every time a request arrives. If you press the button [compile] in admin, they will be bytecode compiled and some other optimizations are performs.

If your app (in models and controllers) does "import somemodule", then the import statement is executed at every request but "somemodule" is actually imported only the first time it is executed, as you asked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜