Merge pull request #98 from sealevelresearch/add-slug-to-locations-endpoint

Add slug to serializer field for /locations
Remove seconds from datetime format

We only support datetimes rounded to the nearest minute, so no point in
being able to parse seconds. This will also enforce that constraint at
the parser level rather than in our code, which is good.
Merge pull request #100 from sealevelresearch/remove-seconds-from-datetime-format

Remove seconds from datetime format
Tweak error message in Minute model
Merge pull request #101 from sealevelresearch/tweak-error-message

Tweak error message in Minute model
Add the concept of token authentication to the API

Install the `rest_framework.authtoken` app which allows you to add
authentication tokens for particular users. This will allow us to make
eg a `surge-model-collector` user with their own token.

We've currently got only read-only endpoints so this shouldn't have any
effect, but it is required for implementing the writeable
surge/measurement endpoints.

[#78037278] [#80542816] [#78441914]
Upversion djangorestframework 2.4.1 => 2.4.3

Which provides new migrations for `authtoken` app.
Merge pull request #102 from sealevelresearch/rest-framework-authentication

Add the concept of token authentication to the API
Use django rest framework 3.0 pre-release

See https://github.com/tomchristie/django-rest-framework/blob/version-3.0/docs/topics/3.0-announcement

Bear in mind for [#78037278]
Remove `method_name` from `SerializerMethodField`

See https://github.com/tomchristie/django-rest-framework/blob/version-3.0/docs/topics/3.0-announcement.md#optional-argument-to-serializermethodfield
Use `.query_params` rather than `.QUERY_PARAMS`

See
https://github.com/tomchristie/django-rest-framework/blob/version-3.0/docs/topics/3.0-announcement.md#the-data-and-query_params-properties
Replace `lookup_field` with `extra_kwargs`

In `HyperlinkedModelSerializer` for location.

See https://github.com/tomchristie/django-rest-framework/blob/version-3.0/docs/topics/3.0-announcement.md#changes-to-hyperlinkedmodelserializer
Point requirements.txt at a specific commit.
Add tests for new write-only surge endpoint

- ability to create & update surge predictions
- disallow HTTP GET
- UTC datetime validity checking
- token authentication:

  * requires header: `Authorization: Token xxx`
  * token must belong to a Django user
  * Django user must have `create_surgeprediction` permission
  * HTTP 401 / 403 for header missing / forbidden

Note that we can't currently send multiple JSON records, see
https://github.com/tomchristie/django-rest-framework/issues/1965

https://www.pivotaltracker.com/story/show/80542816 [#80542816]
Implement write-only surge predictions endpoint

ie `/1/predictions/surge-levels/liverpool-gladstone-dock/`

We're using django rest framework 3.0.0 which isn't yet released, but
the serializer API is substantially rewritten so it doesn't make sense
to build on 2.4.x.