Fix most remaining Django and Python deprecation warnings in the sso codebase itself.
Some of the remaining ones probably need fixing in dependencies: - django-statsd - django-openid-auth - django-piston - django-honeypot - raven - preflight - oauthlib
Other than the ones from dependencies, the remaining deprecation warnings are:
- most of the middlewares. RemovedInDjango20Warning: Old-style middleware using settings.MIDDLEWARE_CLASSES is deprecated. Update your middleware and use settings.MIDDLEWARE instead. - identityprovider/models/twofactor.py:103: RemovedInDjango20Warning: Using user.is_authenticated() and user.is_anonymous() as a method is deprecated. Remove the parentheses to use it as an attribute. This needs updating django-openid-auth to make its is_authenticated method an attribute, to avoid ugly "is it callable?" logic in SSO itself.
Merged from https://code.launchpad.net/~roadmr/canonical-identity-provider/fix-deprecation-warnings-3/+merge/347154