code: def enable(self, force=False):
          
          log = logging.getLogger('ipsv.models.sites.site')
          log.debug('Disabling all other sites under the domain %s', self.domain.name)
          Session.query(Site).filter(Site.id != self.id).filter(Site.domain == self.domain).update({'enabled': 0})
  
          sites_enabled_path = _cfg.get('Paths', 'NginxSitesEnabled')
          server_config_path = os.path.join(_cfg.get('Paths', 'NginxSitesAvailable'), self.domain.name)
          server_config_path = os.path.join(server_config_path, '{fn}.conf'.format(fn=self.slug))
          symlink_path = os.path.join(sites_enabled_path, '{domain}-{fn}'.format(domain=self.domain.name,
                                                                                 fn=os.path.basename(server_config_path)))
          links = glob(os.path.join(sites_enabled_path, '{domain}-*'.format(domain=self.domain.name)))
          for link in links:
              if os.path.islink(link):
                  log.debug('Removing existing configuration symlink: %s', link)
                  os.unlink(link)
              else:
                  if not force:
                      log.error('Configuration symlink path already exists, but it is not a symlink')
                      raise Exception('Misconfiguration detected: symlink path already exists, but it is not a symlink '
                                      'and --force was not passed. Unable to continue')
                  log.warn('Configuration symlink path already exists, but it is not a symlink. Removing anyways '
                           'since --force was set')
                  if os.path.isdir(symlink_path):
                      shutil.rmtree(symlink_path)
                  else:
                      os.remove(symlink_path)
  
          log.info('Enabling Nginx configuration file')
          os.symlink(server_config_path, symlink_path)
  
          self.enabled = 1
          Session.commit()
docs: Enable this site