Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Redeploy Django projects using management commands

Project Description

Redeploy Django projects using management commands

What does it do?

Using Fabric to run a management command on each remote instance to redeploy itself.

The remote command will pull the source code from Git, run all necessary Django management commands, and restart the server.

It’s intended for small to medium scale apps.

Why not just write a Fabric script?

It’s faster. When the you run everything remotely it only takes about 10 seconds to deploy an instance.

What commands will run?

  • git pull
  • pip install -r requirements.txt
  • syncdb
  • migrate
  • collectstatic
  • restart server (webserver dependent)


  • A deployed instance running either:
    • Apache with mod_WSGI
    • GUnicorn
  • Fabric
  • A virtualenv dedicated to the project.
  • A Git hosted repository for the project


Add the app to your INSTALLED_APPS setting:



Add the server configuration to your settings file:

    'default': {
        'HOST': '',         # IP or domain name
        'USER': 'user',                # User to login with
        'BRANCH': 'master',            # Git branch to pull updates from
        'SETTINGS': 'settings',        # Settings file to use (optional)
        'DIR': '/var/www/myproject/',
        'ENV': 'myvirtualenv',         # virtualenv used in the project
        'WEBSERVER': 'gunicorn',       # webserver - 'apache' or 'gunicorn'

        'PID_FILE': '/tmp/',  # Gunicorn pid file path
        'WSGI_FILE': 'deploy/',    # Apache wsgi file path

The PID_FILE / WSGI_FILE settings should be set depending on the web server you’re using.

BRANCH is optional and defaults to master


python deploy_remote default

# Or
python deploy_remote srv1 srv2 #...'

# Don't install requirements:
python deploy_remote default --noreqs

# Deploy all remote instances:
python deploy_remote --all

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(4.3 kB) Copy SHA256 Hash SHA256
Source None Jun 9, 2012

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting