This needs to be a cached_property (available from werkzeug).