예제 #1
0
    def __delitem__(self, key):
        self.mc.delete(key)

    def cleanup(self, timeout):
        pass  # Not needed as we assigned the timeout to memcache


#memcache
session = web.session.Session(app,
                              MemCacheStore(),
                              initializer={
                                  'username': '',
                                  'login': 0
                              })
#普通
#session = web.session.Session(app, web.session.DiskStore('sessions'),initializer={'username':'','login':0})

jjenv = jinja2.Environment(loader=jinja2.FileSystemLoader('templates_web'),
                           extensions=[
                               "jinja2.ext.do",
                           ])

use_connection(conn)

jobq = Queue()

if __name__ == "__main__":
    app.run()
else:
    application = app.wsgifunc()
예제 #2
0
	r"/", "Home",
	"/login","Login",
	"/logout", "Logout",
	"/my", "MySubscription",
	"/subscribe/(.*)", "Subscribe",
	"/unsubscribe/(.*)", "Unsubscribe",
	"/setting", "Setting",
	"/deliver", "Deliver",
	"/register","Register",
	"/admin","Admin",
	"/delfeed/(.*)","Deletefeed",
	"/feedback", "FeedBack",
	"/test", "Test",
)

app = web.application(urls,globals())

session =  web.session.Session(app, web.session.DiskStore('sessions'),initializer={'username':'','login':0})

jjenv = jinja2.Environment(loader=jinja2.FileSystemLoader('templates_web'),extensions=["jinja2.ext.do",])

use_connection(conn)

jobq = Queue()


if __name__ == "__main__":
	app.run()
else:
	application=app.wsgifunc()