django.utils.six.moves.urllib_parse.quote

Here are the examples of the python api django.utils.six.moves.urllib_parse.quote taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

View license
def login_link(request):
    """
    This assumes your login link is the Shibboleth login page for your server 
    and uses the 'target' url parameter.
    """
    full_path = quote(request.get_full_path())
    login = reverse('shibboleth:login')
    ll = "%s?target=%s" % (login, full_path)
    return { 'login_link': ll }

Example 2

View license
def logout_link(request, *args):
    """
    This assumes your login link is the Shibboleth login page for your server 
    and uses the 'target' url parameter.
    e.g: https://school.edu/Shibboleth.sso/Login
    """
    try:
        from app_settings import LOGOUT_URL, LOGOUT_REDIRECT_URL
    except ImportError:
        from .app_settings import LOGOUT_URL, LOGOUT_REDIRECT_URL
    #LOGOUT_REDIRECT_URL specifies a default logout page that will always be used when
    #users logout from Shibboleth.
    target = LOGOUT_REDIRECT_URL or quote(request.build_absolute_uri())
    logout = reverse('shibboleth:logout')
    ll = "%s?target=%s" % (logout, target)
    return { 'logout_link': ll }