×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Yan Anisimov
Added: Sep 19, 2017 4:50 AM
Views: 2542
Tags: flask
  1. # -*- coding: utf-8-*-
  2. # !/usr/bin/env python
  3.  
  4. from flask import Flask, Response, send_from_directory
  5. from flask import request
  6.  
  7. app = Flask(__name__, static_url_path='',static_folder=os.path.dirname(os.path.abspath(__file__)) + '/static/')
  8.  
  9.  
  10. @app.route('/')
  11. @app.route('/<path:path>')
  12. def static_file(path):
  13.     print path
  14.     return app.send_static_file(path)
  15.  
  16.