code: def deploy():
      
      _require_root()
  
      if not confirm("This will apply any available migrations to the database. Has the database been backed up?"):
          abort("Aborted.")
      if not confirm("Are you sure you want to deploy?"):
          abort("Aborted.")
  
      with lcd(PRODUCTION_DOCUMENT_ROOT):
          with shell_env(PRODUCTION="TRUE"):
              local("git pull")
              with open("requirements.txt", "r") as req_file:
                  requirements = req_file.read().strip().split()
                  try:
                      pkg_resources.require(requirements)
                  except pkg_resources.DistributionNotFound:
                      local("pip install -r requirements.txt")
                  except Exception:
                      traceback.format_exc()
                      local("pip install -r requirements.txt")
                  else:
                      puts("Python requirements already satisfied.")
              with prefix("source /usr/local/virtualenvs/ion/bin/activate"):
                  local("./manage.py collectstatic --noinput", shell="/bin/bash")
                  local("./manage.py migrate", shell="/bin/bash")
              restart_production_gunicorn(skip=True)
  
      puts("Deploy complete.")
docs: Deploy to production.