'/Application', 'app.controllers.attendant.Application', '/SendApplication', 'app.controllers.attendant.SendApplication', '/ApplicationRoute', 'app.controllers.attendant.ApplicationRoute', '/UserManage', 'app.controllers.admin.UserManage', '/ResetUserPassword', 'app.controllers.admin.ResetUserPassword', '/AddArticle', 'app.controllers.articlemanage.AddArticle', '/DelArticle', 'app.controllers.articlemanage.DelArticle', '/AlterArticle', 'app.controllers.articlemanage.AlterArticle', '/UserDetail', 'app.controllers.detail.UserDetail', '/RegReport', 'app.controllers.report.RegReport', ) app = web.application(urls, globals()) session.add_sessions_to_app(app) web.config._title_list = articles.gen_title_list() application = app.wsgifunc() if __name__ == "__main__": app.run()
# !/usr/bin/env python # -*- coding: utf-8 -*- import web import config import app.controllers from app.helpers import session urls = ( '/checkCode', 'app.controllers.captcha.check_code', '/login', 'app.controllers.account.login', '/logout', 'app.controllers.account.logout', '/index', 'app.controllers.account.index', '/(?:img|js|css)/.*', 'app.controllers.public.public', '/(.*)', 'app.controllers.captcha.index', ) app = web.application(urls, globals()) session.add_sessions_to_app(app) application = app.wsgifunc() if __name__ == "__main__": app.run()
def setup_sessions(app): from app.helpers import session session.add_sessions_to_app(app)