nprapps/app-template — pull request #427 by rnagle (2014-11-08 17:14:50+00:00)
Title: use the app's view_functions dict to find the view to render

I changed `render_all` to use a more reliable way of looking up view functions.

Essentially what this does is avoid a `KeyError` when using named endpoints. For example:

@app.route('/test/', endpoint='some-name')
def test_view():
...

Where `endpoint` differs from the view function name.

This works because `app.app.view_functions` is a dict with keys that correspond to the `endpoint` attribute of each of the app's routes.

Versus `globals()[module].__dict__` which has keys for view function names only.

Works with every method of adding routes that I could think of.