if os.environ['SERVER_SOFTWARE'].startswith('Development'):
    app_scheme = 'http'
else:
    app_scheme = 'https'
app = webapp.WSGIApplication([webapp2.Route('/login', LoginHandler, name=
    'login', schemes=[app_scheme]), webapp2.Route('/profile',
    ProfileHandler, name='profile', schemes=[app_scheme]), webapp2.Route(
    '/', HomeHandler)], debug=True)
How to use WSGI to reroute a user from http to https