def _insert_url(request, redirect_field_name=REDIRECT_FIELD_NAME,<EOL>inserted_url=None):
<EOL>path = request.build_absolute_uri()<EOL>login_scheme, login_netloc = six.moves.urllib.parse.urlparse(<EOL>inserted_url)[:<NUM_LIT:2>]<EOL>current_scheme, current_netloc = six.moves.urllib.parse.urlparse(path)[:<NUM_LIT:2>]<EOL>if ((not login_scheme or login_scheme == current_scheme) and<EOL>(not login_netloc or login_netloc == current_netloc)):<EOL><INDENT>path = request.get_full_path()<EOL><DEDENT>from django.contrib.auth.views import redirect_to_login<EOL>return redirect_to_login(path, inserted_url, redirect_field_name)<EOL>
Redirects to the *inserted_url* before going to the orginal
    request path.