Send django metrics to graphite

Adds request times, request counts and database metrics to graphite.
Merge pull request #209 from alphagov/graph-all-the-things

Send django metrics to graphite
Remove redundant dataset permission

It is not required by any view and is not required in either the new
admin app or the backdrop admin app.
Merge pull request #210 from alphagov/remove-redundant-dataset-permission

Remove redundant dataset permission
Remove django_statsd GraphiteMiddleware

This counts requests but doesn't use a .count suffix. We only aggregate
counting metrics correctly if they use a .count suffix. Rather than
changing our aggregation rules to be very django_statsd specific I have
removed this middleware. Besides, we get the same information from the
timers since they include a counter.
Log Request-Id header from nginx proxy

Our nginxen where SSL termination happens add a unique header for each
request. We should log that, to enable easier tracing in our
distributed system.
Merge pull request #213 from alphagov/feature/log-request-id

Log Request-Id header from nginx proxy
Merge pull request #211 from alphagov/django-statsd-fix

Remove django_statsd GraphiteMiddleware
Ensure that USE_DEVELOPMENT_USERS is always reset

When mocking GOV.UK signon, we set USE_DEVELOPMENT_USERS to False
so that we can test things properly.

However, if the code being tested raises an exception, we never
set the setting back to its original value.

Wrap the call in a try/finally, so that we always reset the setting.

With thanks to @robyoung for diagnosing this.
Validate dashboards before saving

Previously we were not validating dashboards as part of the save
process. This commit:

- Validates dashboards
- Catches validation errors and returns a JSONified 400 to the user
- Updates test data to be valid
Merge pull request #215 from alphagov/validate-dashboard-before-saving

Validate dashboards before saving
Initial suggestion for FCO schemas

This is intended to support data capture and display for:

- number of appointments booked
- number of appointments booked, at consular level
- appointments by consular service type
- appointments by consular service type, at consular level
- appointments by channel, overall and at consular level
- number of no-shows for appointments, overall and at consular level
- usage of available hours, overall and by consulate
Merge pull request #212 from alphagov/feature/fco-jsonschema

Initial suggestion for FCO schemas
Add in JsonEncoder class

- This is a requirement so that we can json encode our UUIDs. This wasn't present in the tests previously as we were always doing a create
[#75970986] Add update via `PUT` to dashboard method

The pattern has changed a bit now, but looks something like:
- To create a dashboard, `POST` to it without a resource id
- To edit it, send a `PUT` request, complete with a resource id

Innovations towards progress:
- `get_object_or_404` the dashboard you're attempting to update when you send a dashboard id
- `@require_http_methods(['POST', 'PUT'])` around the dashboard method to be a bit more explicit about what kind of things we expect in the `view` (*vis.* API controller)
- Adds a new route in `urls.py` for `dashboard/dashboard_id` so we can update pre-existing dashboards
Merge pull request #216 from alphagov/update_dashboard_with_put

[#75970986] Update dashboard via `PUT`
Add landscape.io code quality badge
Merge pull request #217 from alphagov/add-quality

Add landscape.io code quality badge
Remove a comment and make spotlight specific stuff clear

As this view also contains generic view stuff I was to make it clear you
can ignore the first bit when you're thinking about this
Test redirect redirects

Add in this test because a preview version of the previous commit should
have caused a test failure - it failed to redirect but this was not
caught