class SSLMiddleware(object):

    def process_request(self, request):
        if not any([settings.DEBUG, request.is_secure(), request.META.get(
            'HTTP_X_FORWARDED_PROTO', '') == 'https']):
            url = request.build_absolute_uri(request.get_full_path())
Как сделать python только на Heroku https?