Add new template loaders for conditional caching and namespaced apps.

This adds two new template loaders intended to directly replace standard
Django template ones.

The new 'conditional_cached' template loader functions like Django's
'cached' loader, but does not cache if DEBUG is True. This helps a lot
with development, since it's no longer necessary to reload the server
after modifying a template.

The new 'namespaced_app_dirs' template loader is like Django's
'app_directories' loader, but accepts an optional namespace prefix in
the form of 'app.path:'. If specified, the list of template directories
will be limited to those owned by the given app path.

Reviewed at https://reviews.reviewboard.org/r/6070/
Move the Djblets release notes into ReST files.

This removes the old NEWS file and splits up all the release notes into
ReST files. These can later be shown directly on the Review Board
website, instead of having to go through the NEWS files on
downloads.reviewboard.org. This will also make it easier for us to link
to Djblets release notes in other docs.

Each of these files were copy/pasted from their NEWS sections, with some
macros and regexes used to transform them into the proper format. I also
went through some of them and fixed up styling, and added appropriate
ReST markup where needed.

Reviewed at https://reviews.reviewboard.org/r/6067/
Allow templates to override the list of actions in the Extensions page.

The Extensions page now includes a new 'extension_list_actions' block
that can be overridden to provide actions. By default, it includes the
"Scan for extensions" action. Templates extending this should retain the
parent block's content and then add to it.

Reviewed at https://reviews.reviewboard.org/r/6071/
Rename "Scan for new extensions" to "Scan for installed extensions".

This renames the scan action to say "installed" instead of "new," making
it more clear that we're not looking for new extensions from some remote
source, but rather those that have since been installed.

Reviewed at https://reviews.reviewboard.org/r/6072/
Fix display of form validation errors in config forms.

The config forms code wasn't allowing errors to be shown on the forms,
and had other issues that prevented proper error reporting:

1. We didn't implement a post() function on the view, meaning that
   TemplateView would default to a Method Not Allowed.

2. We weren't replacing the form instance within the page, resulting in
   a clean form being used, free of errors.

3. We weren't showing non-field errors on the form.

This fixes these cases so that form validation errors will be shown
correctly.

It also moves all the POST handling into the new post() function, where
it really belongs.

Reviewed at https://reviews.reviewboard.org/r/6076/
Fix some bad assumptions for web API auth backends.

The web API auth backend support made a couple bad assumptions that
made it hard to write additional backends.

If the Basic Auth backend was first, and it encountered something that
wasn't a Basic Auth authorization header, it would log failures, even
though it wasn't the target backend. We now perform the realm check
first before trying to parse it.

The base WebAPIAuthBackend class itself was assuming in some places that
backends would want a username and a password. Working around that
assumption meant overriding login_with_credentials(). Now, that function
no longer cares about the specific contents of credentials, and farms
out to the Django auth backends and to a new validate_credentials() for
any specifics, making it easier to override.

Along with this, we now log all credential information passed to the
API, being careful to mask any sensitive information.

Reviewed at https://reviews.reviewboard.org/r/6077/
Add an ability to hook into webapi method view calling.

WebAPIResource.__call__ no longer directly calls the method-based view
(get, create, etc.). Instead, it calls the new call_method_view()
function, which defaults to calling the view. Subclasses can override
this to perform additional checks or pass additional data without having
to decorate all views.

Reviewed at https://reviews.reviewboard.org/r/6086/
Fix infinite recursion when serializing object loops.

If two objects reference each other, and the relevant fields are listed in the
'expand' parameter, the serialization of the response would get a recursion
depth RuntimeError and return 500. This manifested in Review Board using the
"Depends On" field, with two review requests that referenced each other.

I've added some code to make each resource name in "expand" apply only once
for the entire serialization. This makes it possible to still expand deep into
object trees, but prevents infinite loops. To expand multiple levels with the
same resource name, it can be listed twice in 'expand'.

Testing done:
- Tested setting a review request's "Depends On" to itself.
- Tested a loop of two objects in "Depends On".
- Tested recursing multiple levels via:
  curl /api/review-requests/1/?expand=depends_on,depends_on | python -mjson.tool

Fixes bug 3442.

Reviewed at https://reviews.reviewboard.org/r/6095/
Merge branch 'release-0.8.x'