def parse_dsn(dsn):
    """Parse dsn string."""
    parsed_dsn = urlparse(dsn)
    parsed_path = parse_path(parsed_dsn.path)
    return {
        'scheme': parsed_dsn.scheme,
        'sender': parsed_dsn.username,
        'token': parsed_dsn.password,
        'domain': parsed_dsn.hostname,
        'port': parsed_dsn.port or 80,
        'version': parsed_path.get('version'),
        'project': parsed_path.get('project'),
    }
def parse_dsn ( dsn ) : parsed_dsn = urlparse ( dsn ) parsed_path = parse_path ( parsed_dsn . path ) return { 'scheme' : parsed_dsn . scheme , 'sender' : parsed_dsn . username , 'token' : parsed_dsn . password , 'domain' : parsed_dsn . hostname , 'port' : parsed_dsn . port or 80 , 'version' : parsed_path . get ( 'version' ) , 'project' : parsed_path . get ( 'project' ) , }
Parse dsn string.