def _force_https():
    if not app.debug:
        from flask import _request_ctx_stack
if _request_ctx_stack is not None:
    reqctx = _request_ctx_stack.top
Make Flask's url_for use the 'https' scheme in an AWS load balancer without messing with SSLify