code: 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'),
      }
docs: Parse dsn string.