diff options
Diffstat (limited to 'ickweb/app.py')
-rw-r--r-- | ickweb/app.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ickweb/app.py b/ickweb/app.py new file mode 100644 index 0000000..f420098 --- /dev/null +++ b/ickweb/app.py @@ -0,0 +1,22 @@ +import bottle + + +COOKIE = 'ickweb1' + + +def create_app(): + app = bottle.Bottle() + + @app.route('/') + def root(): + if bottle.request.get_cookie(COOKIE) == 'yes': + return bottle.template('index') + else: + return bottle.template('login') + + @app.route('/callback') + def callback(): + bottle.response.set_cookie(ICKWEB, 'yes') + bottle.redirect('/') + + return app |