Skip to content

Instantly share code, notes, and snippets.

@jochenklar
Last active November 17, 2022 15:10
Show Gist options
  • Save jochenklar/f9ed6a1d5268ebd4c5b787383e6c96f2 to your computer and use it in GitHub Desktop.
Save jochenklar/f9ed6a1d5268ebd4c5b787383e6c96f2 to your computer and use it in GitHub Desktop.
A script to reset RDMO for development using the testing fixtures.
#!/bin/bash
RDMO=~/code/rdmorganiser/rdmo
python manage.py print_settings | grep -E '^DEBUG\s*=\s(True)' > /dev/null
[ $? -ne 0 ] && echo 'DEBUG is not True' && exit 1
python manage.py check
[ $? -ne 0 ] && echo 'check failed' && exit 1
python manage.py reset_db --noinput
python manage.py migrate
python manage.py setup_groups
python manage.py loaddata ../rdmo/testing/fixtures/groups.json
python manage.py loaddata ../rdmo/testing/fixtures/users.json
python manage.py loaddata ../rdmo/testing/fixtures/sites.json
python manage.py loaddata ../rdmo/testing/fixtures/*
rsync -av --delete ../rdmo/testing/media/ media_root/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment