old_contents: from fabric.api import *
  
  
  env.roledefs = {
      'staging': [],
      'production': [],
  }
  
  
  @roles('staging')
  def deploy_staging():
      # Remove this line when you're happy that this task is correct
      raise RuntimeError("Please check the fabfile before using it")
  
      run('git pull origin staging')
      run('pip install -r requirements.txt')
      run('django-admin migrate --noinput')
      run('django-admin collectstatic --noinput')
      run('django-admin compress')
      run('django-admin update_index')
  
      # 'restart' should be an alias to a script that restarts the web server
      run('restart')
  
  
  @roles('production')
  def deploy_production():
      # Remove this line when you're happy that this task is correct
      raise RuntimeError("Please check the fabfile before using it")
  
      run('git pull origin master')
      run('pip install -r requirements.txt')
      run('django-admin migrate --noinput')
      run('django-admin collectstatic --noinput')
      run('django-admin compress')
      run('django-admin update_index')
  
      # 'restart' should be an alias to a script that restarts the web server
      run('restart')
  
new_contents: from fabric.api import *
  
  
  env.roledefs = {
      'production': [],
      'staging': [],
  }
  
  
  @roles('production')
  def deploy_production():
      # Remove this line when you're happy that this task is correct
      raise RuntimeError("Please check the fabfile before using it")
  
      run('git pull origin master')
      run('pip install -r requirements.txt')
      run('django-admin migrate --noinput')
      run('django-admin collectstatic --noinput')
      run('django-admin compress')
      run('django-admin update_index')
  
      # 'restart' should be an alias to a script that restarts the web server
      run('restart')
  
  
  @roles('staging')
  def deploy_staging():
      # Remove this line when you're happy that this task is correct
      raise RuntimeError("Please check the fabfile before using it")
  
      run('git pull origin staging')
      run('pip install -r requirements.txt')
      run('django-admin migrate --noinput')
      run('django-admin collectstatic --noinput')
      run('django-admin compress')
      run('django-admin update_index')
  
      # 'restart' should be an alias to a script that restarts the web server
      run('restart')
  
subject: Reorder fabfile