Fix our caching logic to be more strict.

Our caching logic took the Last Modified time over ETags, but this meant
that if ETags differed but Last Modified was the same, the cached
version would be considered good. We now take both into account when
checking cache validity.
Massively speed up datagrid rendering.

While investigating a slowdown with the new RBCommons deployment, I
realized we were creating a RequestContext over and over again. Once for
every rendered cell. It was excessive.

I've changed it to only create one RequestContext per request, total,
and to reuse those values for any new contexts used when rendering a
cell.

Prior to this, our weirdly slow RBCommons datagrid rendering on the new
instance was hovering around 6 seconds. After, it was at just around 1
second without any cached queries, and 0.5 seconds after.

While we still need to track down what's going on on that instance, I
can say that our datagrid rendering has never been faster.
Install an extension on-the-fly from a remote source.

Added a method to djblet's extension manager that installs an extension,
given a remote URL with the extension egg and package name.

This modification is required as a pre-requisite, for the upcoming
extension browser module to ReviewBoard.

There could be possible errors such as (but not limited to): The URL
being a 404, incorrect package_name, incompatible egg or the package
being already present. These would be thrown as exceptions and have to
be handled by the caller appropriately.

Reviewed at http://reviews.reviewboard.org/r/3973/
Release Djblets 0.7.12.
Add support for better request info logging.

This adds support for a 'request' parameter to Python's logging calls.
When provided, we'll log the request information (customizable by the
the project). By default, this will show the user and the path.

This information makes it much easier to see who's triggering what
problems or code paths.

It's a bit evil that we're hijacking the root logger's _log function,
but it should be safe in all versions of Python we support.

Other call sites have been updated to provide a request when possible.
However, they pass the request using Python logging's 'extra' parameter
instead of our new request parameter, so that any existing apps don't
suddenly break if they don't use djblets.log.

Some call sites (such as the cache_memoize code) don't provide a
request, since they have none. Unfortunately, in these cases, we just
won't have this additional information.
Fix pyflakes warnings.

This fixes a couple pyflake warnings. Only one (which I just introduced
and only happens in an unexpected error) were at all problematic.
Fix configuration of the STATIC_URL in siteconfig.

Our siteconfig code was properly turning the site_static_url setting
into settings.STATIC_URL, but it's too late at this point. Django has
already created the StaticFilesStorage and populated it with the default
settings.STATIC_URL.

Fortunately, this all happens before that URL is ever used (since this
is before any templates are rendered). So we can just grab the
staticfiles_storage instance and replace the URL.