Guest User

Untitled

a guest
Jul 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. from flask import Flask, session
  2.  
  3. @app.route('/my-route')
  4. def my_route():
  5. id = request.args.get('id')
  6. schema = Schema({
  7. Required('id'): All(Coerce(str))
  8. })
  9. try:
  10. schema({'id': id})
  11. except MultipleInvalid as e:
  12. str(e)
  13.  
  14. ans=test(session[‘id’])
  15. return ans
  16.  
  17. if __name__ == '__main__':
  18.  
  19. app.secret_key = 'super secret key'
  20. app.config['SESSION_TYPE'] = 'filesystem'
  21.  
  22. sess.init_app(app)
  23.  
  24. app.debug = True
  25.  
  26. app.run()
Add Comment
Please, Sign In to add comment