]>
git.ipfire.org Git - people/ms/webapp.git/blob - application/__init__.py
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",
25 (r
"/login", LoginHandler
),
26 (r
"/logout", LogoutHandler
),
27 ] #self.get_handlers()
29 tornado
.web
.Application
.__init
__(self
, handlers
, **settings
)
31 # # XXX This is not a nice solution but works for the moment
32 # def get_handlers(self):
33 # handlers_dir = os.path.join(BASEDIR, "pages")
34 # sys.path.append(handlers_dir)
37 # for handler in os.listdir(handlers_dir):
38 # if not handler.endswith(".py"):
41 # handler = handler[:-3]
42 # handler = __import__(handler)
44 # if type(handler.handle) == type([]):
45 # handlers.extend(handler.handle)
47 # handlers.append(handler.handle)