title: How to get path of sub directory of a temporary directory in Django
body: <p>I need to pass path of subdirectory of a temporary directory to another function.</p>
  
  <p><strong>Real scenario:</strong></p>
  
  <p>User will upload a zip or tar archive then it will be extracted inside a temporary directory, now I need the path of that extracted directory.</p>
  
  <p>is there a way to get path of a subdirectory in case we couldn't known the name of that directory?
  Here's what I'm doing in code;</p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>            if form.is_valid():
                 deployment = TarWithDocker()
                 deployment.name = form.cleaned_data['name']
                 deployment.user = request.user
                 deployment.archive = form.cleaned_data['archive']
                 deployment.save()
                 tmpdir = tempfile.mkdtemp()
                 saved_umask = os.umask(0o077)
                 path = os.path.join(tmpdir)
                 arpath = deployment.archive.path
                 patoolib.extract_archive(arpath, outdir=path)
                 client = docker.from_env()
                 dirp = os.path.join(path)
                 client.images.build(path=# Here i need to pass sub path of directory of temp dir   #}
                                  , gzip=False, tag='newdep')
                 os.umask(saved_umask)
                 shutil.rmtree(tmpdir)
  </code></pre>
  
  <p>Help me, please!
  Thanks in Advance!</p>