Skip to content

Commit

Permalink
Introduced session handler to the skell application.
Browse files Browse the repository at this point in the history
Refs: #27
  • Loading branch information
piraz committed Jul 26, 2015
1 parent ed418aa commit 5d41574
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions firenado/examples/skell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ class SkellComponent(firenado.core.TornadoComponent):
def get_handlers(self):
return [
(r'/', skell.handlers.IndexHandler),
(r'/session', skell.handlers.SessionHandler),
]
9 changes: 9 additions & 0 deletions firenado/examples/skell/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ class IndexHandler(firenado.core.TornadoHandler):
def get(self):
self.write("IndexHandler output")

class SessionHandler(firenado.core.TornadoHandler):

def get(self):
counter = 0
if self.session.has('counter'):
counter = self.session.get('counter')
counter += 1
self.session.set('counter', counter)
self.write("Counter: %i" % counter)
#self.render("index.html", initial_message="Hello world!!!")

0 comments on commit 5d41574

Please sign in to comment.