From 3038292daee114f22417495bfac4dcd105ee955a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 3 Aug 2018 13:53:56 +0300 Subject: Add: initial commit --- ickweb/__init__.py | 1 + ickweb/app.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ickweb/__init__.py create mode 100644 ickweb/app.py (limited to 'ickweb') diff --git a/ickweb/__init__.py b/ickweb/__init__.py new file mode 100644 index 0000000..819ccf0 --- /dev/null +++ b/ickweb/__init__.py @@ -0,0 +1 @@ +from .app import create_app 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 -- cgit v1.2.1