summaryrefslogtreecommitdiff
path: root/ickweb
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-08-03 13:53:56 +0300
committerLars Wirzenius <liw@liw.fi>2018-08-03 13:53:56 +0300
commit3038292daee114f22417495bfac4dcd105ee955a (patch)
treecfff0f1bff59759423b4082d6a9635cd13993ffa /ickweb
downloadickweb-3038292daee114f22417495bfac4dcd105ee955a.tar.gz
Add: initial commit
Diffstat (limited to 'ickweb')
-rw-r--r--ickweb/__init__.py1
-rw-r--r--ickweb/app.py22
2 files changed, 23 insertions, 0 deletions
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