def install_sample_user():
  user = None
  try:
    user = auth_models.User.objects.get(id=SAMPLE_USER_ID)
    LOG.info('Sample user found: %s' % user.username)
    if user.username != SAMPLE_USER_INSTALL:
      with transaction.atomic():
        user = auth_models.User.objects.get(id=SAMPLE_USER_ID)
        user.username = SAMPLE_USER_INSTALL
        user.save()
  except auth_models.User.DoesNotExist:
    user, created = auth_models.User.objects.get_or_create(
      username=SAMPLE_USER_INSTALL,
      password='!',
      is_active=False,
      is_superuser=False,
      id=SAMPLE_USER_ID,
      pk=SAMPLE_USER_ID)

    if created:
      LOG.info('Installed a user called "%s"' % SAMPLE_USER_INSTALL)
  except Exception, ex:
    LOG.exception('Failed to get or create sample user')

  fs = cluster.get_hdfs()
  # If home directory doesn't exist for sample user, create it
  try:
    if not fs.do_as_user(SAMPLE_USER_INSTALL, fs.get_home_dir):
      fs.do_as_user(SAMPLE_USER_INSTALL, fs.create_home_dir)
      LOG.info('Created home directory for user: %s' % SAMPLE_USER_INSTALL)
    else:
      LOG.info('Home directory already exists for user: %s' % SAMPLE_USER_INSTALL)
  except Exception, ex:
    LOG.exception('Failed to create home directory for user %s: %s' % (SAMPLE_USER_INSTALL, str(ex)))

  return user
Setup the de-activated sample user with a certain id. Do not create a user profile.
dataset/ETHPy150Open cloudera/hue/apps/useradmin/src/useradmin/models.py/install_sample_user