Updated settings and middleware to properly respond to request.is_secure() calls and properly do redirects with www and non-www domains when using https
Merge branch 'apiv2'