Skip to content

Instantly share code, notes, and snippets.

@eyeseast
Created January 12, 2011 21:06
Show Gist options
  • Save eyeseast/776879 to your computer and use it in GitHub Desktop.
Save eyeseast/776879 to your computer and use it in GitHub Desktop.
def get_app_data(project_path=None, app=None):
"Run dumpdata in a remote project and download the resulting JSON"
if not project_path:
project_path = prompt("Where do we find your project?")
if not app:
app = prompt("What app do you want data from?")
with cd(project_path):
run('python manage.py dumpdata %s --format=json --indent=4 > %s.json' % (app, app))
get('~/%s/%s.json' % (project_path, app), '%s.json' % app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment