nutools/lib/ulib/templates/webpyapp/server.py

27 lines
777 B
Python
Raw Normal View History

2021-02-24 10:55:56 +04:00
#!/usr/bin/env python22
2017-07-17 21:59:20 +04:00
# -*- coding: utf-8 mode: python -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
__all__ = ('Server',)
import sys, os
from os import path
SCRIPTDIR = path.abspath(path.split(__file__)[0])
sys.path.insert(0, path.join(SCRIPTDIR, 'lib/python'))
2017-07-17 21:59:20 +04:00
from ulib.web import web, Application, Page, defaults
class Server(Application):
def __init__(self, basedir=None, templatedir=None, host=None, port=None, debug=None):
2017-07-20 00:16:02 +04:00
super(Server, self).__init__(basedir, templatedir, host, port, debug)
2017-07-17 21:59:20 +04:00
def _new_session(self):
pass # décommenter la ligne suivante pour activer les sessions
#return web.session.DiskStore('sessions'), {}
2017-07-17 21:59:20 +04:00
class index(Page):
PREFIX = r'/'
if __name__ == '__main__':
Server(SCRIPTDIR).run(sys.argv[1:])