'Modify the redirect from /wiki/123 to /course/foo/bar/wiki/123/
if the referrer comes from a course page'

def process_response(self, request, response):

    if ((response.status_code == 302) and response['Location'].startswith('/wiki/')):
        wiki_path = urlparse(response['Location']).path.split('/wiki/', 1)[1]
        response = (self._redirect_from_referrer(request, wiki_path) or response)
    reverse._transform_url = (lambda url: url)
    return response
