Merge the rest-framework gist.

Gist at: https://gist.github.com/vdboor/a4629d7f3d4158f3a229/edit