views.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. # -*- coding=UTF-8 -*-
  3. # **************************************************************************
  4. # Copyright © 2016 jianglin
  5. # File Name: views.py
  6. # Author: jianglin
  7. # Email: xiyang0807@gmail.com
  8. # Created: 2016-06-15 00:11:56 (CST)
  9. # Last Update:星期六 2016-7-2 21:9:48 (CST)
  10. # By:
  11. # Description:
  12. # **************************************************************************
  13. from flask import Blueprint, render_template, send_from_directory
  14. from os import path as ph
  15. site = Blueprint('docs',
  16. __name__,
  17. template_folder='templates',
  18. static_folder='static')
  19. @site.route('/')
  20. def docs():
  21. return render_template('docs/doc_list.html')
  22. @site.route('/flask-maple/<path:path>')
  23. def flask_maple(path):
  24. return send_from_directory(
  25. ph.join(site.static_folder, 'flask-maple'), path)
  26. @site.route('/flask-avatar/<path:path>')
  27. def flask_avatar(path):
  28. return send_from_directory(
  29. ph.join(site.static_folder, 'flask-avatar'), path)