Created
March 31, 2012 05:21
-
-
Save DavidLGoldberg/2259618 to your computer and use it in GitHub Desktop.
Serve up static content in heroku's public folder
This file contains hidden or 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
import os | |
from flask import Flask | |
from werkzeug import SharedDataMiddleware | |
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) | |
app = Flask(__name__, | |
static_folder=os.path.join(PROJECT_ROOT, 'public'), | |
static_url_path='/public') | |
app.wsgi_app = SharedDataMiddleware(app.wsgi_app, | |
{'/': os.path.join(os.path.dirname(__file__), 'public') }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment