docs: def deploy():
      """
      Deploy latest version of the project.
      Backup current version of the project, push latest version of the project
      via version control or rsync, install new requirements, sync and migrate
      the database, collect any new static assets, and restart gunicorn's worker
      processes for the project.
      """
      if not exists(env.proj_path):
          if confirm("Project does not exist in host server: %s"
                     "\nWould you like to create it?" % env.proj_name):
              create()
          else:
              abort()
  
      # Backup current version of the project
      with cd(env.proj_path):
          backup("last.db")
      if env.deploy_tool in env.vcs_tools:
          with cd(env.repo_path):
              if env.deploy_tool == "git":
                      run("git rev-parse HEAD > %s/last.commit" % env.proj_path)
              elif env.deploy_tool == "hg":
                      run("hg id -i > last.commit")
          with project():
              static_dir = static()
              if exists(static_dir):
                  run("tar -cf static.tar --exclude='*.thumbnails' %s" %
                      static_dir)
      else:
          with cd(join(env.proj_path, "..")):
              excludes = ["*.pyc", "*.pio", "*.thumbnails"]
              exclude_arg = " ".join("--exclude='%s'" % e for e in excludes)
              run("tar -cf {0}.tar {1} {0}".format(env.proj_name, exclude_arg))
  
      # Deploy latest version of the project
      with update_changed_requirements():
          if env.deploy_tool in env.vcs_tools:
              vcs_upload()
          else:
              rsync_upload()
      with project():
          manage("collectstatic -v 0 --noinput")
          manage("migrate --noinput")
      for name in get_templates():
          upload_template_and_reload(name)
      restart()
      return True