nvie/rq-dashboard — pull request #68 by jonafato (2014-09-19 03:59:25+00:00)
Title: Use url_for('.overview') instead of extension.url_prefix for rq_url_prefix

Currently, the `RQDashboard` extension does not work properly for apps served as a mount behind a `DispatcherMiddleware` object. Using `url_for` here instead of `extension.url_prefix` allows flask to properly build the full route in this case. See the sample code below for a test (the dashboard is at http://localhost:5000/bar/rq/ in this example).

```python
from flask import Flask
from rq_dashboard import RQDashboard
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware

foo = Flask('foo')
bar = Flask('bar')
RQDashboard(bar)

@foo.route('/')
def hello():
return 'Hello, World!'

@bar.route('/')
def goodbye():
return 'Goodbye, World!'

if __name__ == '__main__':
run_simple('localhost', 5000, DispatcherMiddleware(foo, {'/bar': bar}))
```