Skip to content

Instantly share code, notes, and snippets.

@sebastibe
Last active October 10, 2015 20:38
Show Gist options
  • Save sebastibe/3747401 to your computer and use it in GitHub Desktop.
Save sebastibe/3747401 to your computer and use it in GitHub Desktop.
serving static files locally in Flask
from flask import Flask
app = Flask(__name__)
if app.config['DEBUG']:
from werkzeug.wsgi import SharedDataMiddleware
import os.path
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, {
'/static': os.path.join(os.path.dirname(__file__), 'static')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment