Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython

kpages is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.5.3.dev Failed View build log
0.5.3.dev Failed View build log
 
Links
Author
License
http://www.apache.org/licenses/LICENSE-2.0
Lastest release
version 0.5.3.dev on Sep 20th, 2013

#kpages

######kpages is mini helper for tornado,Contains the address routing management,tornado and app config management, mongodb, redis connection management and other functions; these things can help you quickly build a web application.

######基于Tornado的开发包,提供地址路由、配置、测试、性能分析、数据库及内存连接上下文管理等,如果你想用Tornado提供一些高性能的服务接口,这会给你很大的帮助的。

##router

restful/index.py(add @url to class , kpages will route url to this handler) ``` from kpages import url

System Message: WARNING/2 (<string>, line 9); backlink

Inline literal start-string without end-string.

@url(r'/',0) @url(r'/home',2) class HomeHandler(RequestHandler):

System Message: ERROR/3 (<string>, line 16)

Unexpected indentation.
def get(self):
self.write('hello word')

```

System Message: WARNING/2 (<string>, line 19); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 19); backlink

Inline interpreted text or phrase reference start-string without end-string.

setting.py(config for tornado and you app, use __conf__.xxxx to get you config value ) ` ACTION_DIR = 'restful' DEBUG = True PORT= 8989 `

app.py

``` from kpages import run

System Message: WARNING/2 (<string>, line 30); backlink

Inline literal start-string without end-string.
if __name__ == '__main__':
run()

System Message: WARNING/2 (<string>, line 35)

Definition list ends without a blank line; unexpected unindent.

```

System Message: WARNING/2 (<string>, line 35); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 35); backlink

Inline interpreted text or phrase reference start-string without end-string.

How to use mongo and redis context? ``` from kpages import get_context, LogicContext,mongo_conv

System Message: WARNING/2 (<string>, line 37); backlink

Inline literal start-string without end-string.
with LogicContext():
db = get_context().get_mongo() cache = get_context().get_cache() lst = list(db['table'].find().limit(10)) lst = mongo_conv(lst)

` How to use context in hander? ` from kpages import ContextHandler

@url(r'/context/demo') class DemoHandler(ContextHandler):

System Message: ERROR/3 (<string>, line 54)

Unexpected indentation.
def get(self):
db = get_context().get_mongo('dbname') val = self.session(key) self.session(key,val)

System Message: WARNING/2 (<string>, line 58)

Block quote ends without a blank line; unexpected unindent.

` test commend ` run_test(test_city.DemoCase.testprint) :test testprint method run_test(test_city.DemoCase) :test methods in DemoCase class run_test(test_city) :test methods in test_city.py run_test(all ) :test methods in app's __conf__.UTEST_DIR ```

System Message: WARNING/2 (<string>, line 58); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 58); backlink

Inline interpreted text or phrase reference start-string without end-string.

pro commend ``` pro_test(test_city.DemoCase.testprint) :profile testprint method pro_test(test_city.DemoCase) :profile methods in DemoCase class pro_test(test_city) :profile methods in test_city.py pro_test(all) :profile methods in app's __conf__.UTEST_DIR

System Message: WARNING/2 (<string>, line 67); backlink

Inline literal start-string without end-string.

```

System Message: WARNING/2 (<string>, line 74); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 74); backlink

Inline interpreted text or phrase reference start-string without end-string.

Subscribe to package updates

Last updated Sep 20th, 2013

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.