Skip to content

Instantly share code, notes, and snippets.

@arindampradhan
Created September 7, 2016 14:09
Show Gist options
  • Save arindampradhan/aef39280d28f24136a4c8f12582db794 to your computer and use it in GitHub Desktop.
Save arindampradhan/aef39280d28f24136a4c8f12582db794 to your computer and use it in GitHub Desktop.
flask livereload setup
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