Initial commit

This commit is contained in:
Sander
2020-01-04 23:31:28 +01:00
committed by sander
commit fb5678afbb
8 changed files with 786 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
"""
Hello
~~~~~
Quart-Session demo.
:copyright: (c) 2020 by Sander.
:license: BSD, see LICENSE for more details.
"""
from quart import Quart, session
from quart_session import Session
SESSION_TYPE = 'redis'
app = Quart(__name__)
app.config.from_object(__name__)
Session(app)
@app.route('/set/')
def set():
session['key'] = 'value'
return 'ok'
@app.route('/get/')
def get():
return session.get('key', 'not set')
if __name__ == "__main__":
app.run(debug=True)