def setup_server():
    upgrade_packages()
    # Install required system packages for deployment, plus some extras
    apt_packages = ["apache2", "python-psycopg2", "python-setuptools",
        "postgresql", "postgresql-contrib", "libapache2-mod-wsgi", "git-core",
        "subversion", "python-imaging", "postgresql-server-dev-8.4",
        "build-essential", "binutils", "libxml2-dev", "screen", "memcached",
        "mercurial", ]
    install_packages(apt_packages)
    # Install pip, and use it to install virtualenv and virtualenvwrapper
    sudo("easy_install -U pip")
    sudo("pip install -U virtualenv virtualenvwrapper")
    setup_virtualenvwrapper()
    upgrade_packages()
Set up a server for the first time in preparation for deployments.
dataset/ETHPy150Open typeish/django-deploy/django_deploy/system.py/setup_server