Commit graph

15 commits

Author SHA1 Message Date
Brett Smith
cf5b073d44 urls: Route /error/NNN/ to static.views.handler.
Since our Apache configuration uses `ErrorDocument NNN /error/NNN/`,
this is necessary to return the correct status code in those cases.
2016-12-05 21:43:51 -05:00
Brett Smith
58e22337b0 static: Errors return proper HTTP response code. 2016-12-05 21:15:01 -05:00
Brett Smith
3fe5f09d18 static: Remove hardcoded path. 2016-12-05 21:14:45 -05:00
Brett Smith
3705a2ba1d static: Re-fix path manipulation in index.
* Strip any leading / to treat it as a relative path.
* Append `index.html` before converting to bytes.
2016-11-03 10:58:23 -04:00
Brett Smith
93787dc820 static: Don't try to render non-template files as templates. 2016-11-03 10:34:01 -04:00
Brett Smith
6b1b3b8f2e static: Encode paths as UTF-8 before translating to the filesystem. 2016-11-03 10:34:01 -04:00
Brett Smith
39314c254e static: Use built-in methods for path manipulation. 2016-11-02 16:45:34 -04:00
Bradley M. Kuhn
b48b1ab1e5 Avoid query string passed along in rendering.
This middleware is a bit of a mess anyway, since it's basically using
static files as templates.  However, we definitely don't want to add any
GET query parameters rendered into the path name.
2015-12-07 12:24:58 -08:00
Bradley M. Kuhn
5c4cc1e2e1 Add sitefundgoal to top level view context.
The base template now has access to the fund-raising goal that will be
displayed site-wide.  The view here must provide it in the context for
access everywhere.

Furthermore, we need a local context processor to make sure it's in
context everywhere, and we have to make sure that context is properly
passed along.

This code is a bit cargo-culted in, based on what I read in various
places about adding the Request context.
2015-11-30 19:19:46 -08:00
Bradley M. Kuhn
ab2239009a Rework again to see if I can get this corrected. 2015-03-08 23:40:47 -07:00
Bradley M. Kuhn
f64ff43450 Rework to simply call with new kwargs.
Redo call so that I just get my own at call time.
2015-03-08 23:36:38 -07:00
Bradley M. Kuhn
f8f37dd39c Must move import as well. 2015-03-08 23:31:44 -07:00
Bradley M. Kuhn
b3f019265b Rework fundgoal lookup urls data.
The urls.py is of course only evaluated once: at Apache load time, which
means the data in the template became stale and is not dynamic.

This change should cause the lookup to happen at each page view.
2015-03-08 23:28:42 -07:00
Bradley M. Kuhn
09654a5eac Fundraising goal lookup for template: 1st attempt
This seems to be the best approach to pass a fundraising goal record to
a template.  While the static hack that tmarble implemented probably
needs work anyway, this is probably the best way currently to interface
certain general data that we seek to place on many different pages
through the templates.

I looked into a templatetags solution, but this seemed more
straightforward and more fitting with Django principles (I think :).
2015-03-08 20:46:37 -07:00
Tom Marble
2bf594b86c First pass at migration to Django 1.7 2015-03-03 18:40:18 +00:00