def get_default_redirect(request, fallback_url=settings.LOGIN_REDIRECT_URL, redirect_field_name="next", session_key_value="redirect_to"):

   redirect_to = request.REQUEST.get(redirect_field_name)
   if not redirect_to:
       # try the session if available
       if hasattr(request, "session"):
           redirect_to = request.session.get(session_key_value)
   # light security check -- make sure redirect_to isn't garabage.
   if not redirect_to or "://" in redirect_to or " " in redirect_to:
       redirect_to = fallback_url
   return redirect_to
Represent bool as 'yes' or 'no' instead of 'true' or 'false'.
dataset/ETHPy150Open pydanny/django-la-facebook/la_facebook/callbacks/base.py/get_default_redirect--crossover with--dataset/ETHPy150Open beetbox/beets/beets/util/confit.py/Dumper.represent_bool