code: def _get_site(self):
          
          import mwclient
          parts = self.server.settings.wiki.replace("http", "").replace("://", "").split("/")
          self.url = parts[0]
          if len(parts) > 1 and parts[1].strip() != "":
              self.relpath = '/' + '/'.join(parts[1:len(parts)])
              #The API expects us to have a trailing forward-slash.
              if self.relpath[-1] != "/":
                  self.relpath += "/"
              if not self.testmode:
                  self.site = mwclient.Site(self.url, path=self.relpath)
          else:
              if not self.testmode:
                  self.site = mwclient.Site(self.url)
docs: Returns the mwclient.Site for accessing and editing the wiki pages.