guest.py 676 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from flask import Blueprint, render_template, url_for, request
  5. import requests
  6. __author__ = 'James Iter'
  7. __date__ = '2017/5/30'
  8. __contact__ = 'james.iter.cn@gmail.com'
  9. __copyright__ = '(c) 2017 by James Iter.'
  10. blueprint = Blueprint(
  11. 'v_guest',
  12. __name__,
  13. url_prefix='/guest'
  14. )
  15. blueprints = Blueprint(
  16. 'v_guests',
  17. __name__,
  18. url_prefix='/guests'
  19. )
  20. def show():
  21. host_url = request.host_url.rstrip('/')
  22. url = host_url + url_for('api_guests.r_get_by_filter')
  23. ret = requests.get(url=url)
  24. ret = json.loads(ret.content)
  25. return render_template('guest.html', data=ret['data'])