Created
September 7, 2016 14:09
-
-
Save arindampradhan/aef39280d28f24136a4c8f12582db794 to your computer and use it in GitHub Desktop.
flask livereload setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, send_from_directory | |
from livereload import Server | |
app = Flask(__name__, static_url_path='/', static_folder='Views') | |
@app.route('/bower_components/<path:path>') | |
def send_assets(path): | |
return send_from_directory('bower_components', path) | |
@app.route('/') | |
def index(): | |
return app.send_static_file('index.html') | |
if __name__ == '__main__': | |
server = Server(app.wsgi_app) | |
server.serve() | |
server.watch('/Views/*') | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment