(request)
return token
Fetch user token from request.
Fetch user token from request.
Fetch user token from request .
def get_token(request):
    """
    Fetch user token from request.
    """
    # Try and retrieve from a file
    token = request.FILES.get("token")
    if token:
        token = token.readline()

    # If none found in file, search in GET and POST requests.
    token = token or request.GET.get("token") or request.POST.get("token")

    return token
def get_token ( request ) : # Try and retrieve from a file token = request . FILES . get ( "token" ) if token : token = token . readline ( ) # If none found in file, search in GET and POST requests. token = token or request . GET . get ( "token" ) or request . POST . get ( "token" ) return token