SHARE
TWEET

Untitled

a guest Dec 13th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. view = Flask(__name__, static_url_path=‘/subdir/static',static_folder='static')
  2. view.add_url_rule('/static/<filename>', 'static')
  3. print(view.url_map)
  4. ## Map([<Rule '/subdir/static/<filename>' (GET, HEAD, OPTIONS) -> static>,
  5. ## <Rule '/static/<filename>' (GET, HEAD, OPTIONS) -> static>])
  6.    
  7. view = Flask(__name__)
  8. static_url = Blueprint('static_url', __name__, url_prefix='/subdir/', static_folder='static')
  9. view.register_blueprint(static_url)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top