Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, session
- @app.route('/my-route')
- def my_route():
- id = request.args.get('id')
- schema = Schema({
- Required('id'): All(Coerce(str))
- })
- try:
- schema({'id': id})
- except MultipleInvalid as e:
- str(e)
- ans=test(session[‘id’])
- return ans
- if __name__ == '__main__':
- app.secret_key = 'super secret key'
- app.config['SESSION_TYPE'] = 'filesystem'
- sess.init_app(app)
- app.debug = True
- app.run()
Add Comment
Please, Sign In to add comment