]>
git.ipfire.org Git - people/ms/webapp.git/blob - application/__init__.py
e089049362a7739c44fda1488f2b36d6aa16897c
7 BASEDIR
= os
.path
.join(os
.path
.dirname(__file__
), "..")
9 from auth
import LoginHandler
, LogoutHandler
10 from handlers
import MainHandler
12 class Application(tornado
.web
.Application
):
15 template_path
= os
.path
.join(BASEDIR
, "templates"),
16 static_path
= os
.path
.join(BASEDIR
, "static"),
18 cookie_secret
= "123456789",
24 (r
"/login", LoginHandler
),
25 (r
"/logout", LogoutHandler
),
26 ] #self.get_handlers()
28 tornado
.web
.Application
.__init
__(self
, handlers
, **settings
)
30 # # XXX This is not a nice solution but works for the moment
31 # def get_handlers(self):
32 # handlers_dir = os.path.join(BASEDIR, "pages")
33 # sys.path.append(handlers_dir)
36 # for handler in os.listdir(handlers_dir):
37 # if not handler.endswith(".py"):
40 # handler = handler[:-3]
41 # handler = __import__(handler)
43 # if type(handler.handle) == type([]):
44 # handlers.extend(handler.handle)
46 # handlers.append(handler.handle)