Skip to content

Instantly share code, notes, and snippets.

@rjurney
Created June 15, 2012 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjurney/2939061 to your computer and use it in GitHub Desktop.
Save rjurney/2939061 to your computer and use it in GitHub Desktop.
Jinja2 Template being served by Flask on Heroku
import os, sys, time
from flask import Flask, render_template, request, redirect, make_response
PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__, static_folder=os.path.join(PROJECT_ROOT, 'static'), static_url_path='/static')
2012-06-15T22:39:01+00:00 app[web.1]: 10.92.70.219 - - [15/Jun/2012 22:39:01] "GET / HTTP/1.1" 200 -
2012-06-15T22:39:01+00:00 heroku[router]: GET myapp.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=2ms status=200 bytes=1770
2012-06-15T22:39:01+00:00 app[web.1]: 10.44.55.167 - - [15/Jun/2012 22:39:01] "GET /static/bootstrap/docs/assets/css/bootstrap.css HTTP/1.1" 404 -
2012-06-15T22:39:01+00:00 heroku[router]: GET myapp.herokuapp.com/static/bootstrap/docs/assets/css/bootstrap.css dyno=web.1 queue=0 wait=0ms service=2ms status=404 bytes=238
<!-- Why doesn't this work? I get a 404. -->
<link href="{{ url_for('static', filename='bootstrap/docs/assets/css/bootstrap.css') }}" rel="stylesheet">
@rjurney
Copy link
Author

rjurney commented Jun 15, 2012

Because bootstrap was cloned from git and isn't being pushed to heroku.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment