diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-08-03 13:53:56 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-08-03 13:53:56 +0300 |
commit | 3038292daee114f22417495bfac4dcd105ee955a (patch) | |
tree | cfff0f1bff59759423b4082d6a9635cd13993ffa /ickweb | |
download | ickweb-3038292daee114f22417495bfac4dcd105ee955a.tar.gz |
Add: initial commit
Diffstat (limited to 'ickweb')
-rw-r--r-- | ickweb/__init__.py | 1 | ||||
-rw-r--r-- | ickweb/app.py | 22 |
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 |