code: def db_exists():
      
      logger.info("Checking to see if %s already exists", repr(DB["NAME"]))
      try:
          # Hide stderr since it is confusing here
          psql("", stderr=subprocess.STDOUT)
      except subprocess.CalledProcessError:
          return False
      return True
docs: Test if DATABASES['default'] exists