From: Scott Baker Date: Tue, 16 Sep 2014 16:46:35 +0000 (-0700) Subject: load initial data when django 1.7 is installed X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f3526efbc9f344e2e10c2f0ad1569e8f947302df;p=plstackapi.git load initial data when django 1.7 is installed --- diff --git a/planetstack/scripts/opencloud b/planetstack/scripts/opencloud index 901ad80..ff6eefc 100755 --- a/planetstack/scripts/opencloud +++ b/planetstack/scripts/opencloud @@ -7,6 +7,8 @@ fi BACKUP_DIR=/opt/planetstack_backups +DJANGO_17=`python -c "import django; from distutils.version import StrictVersion; print int(StrictVersion(django.get_version()) >= StrictVersion('1.7'))"` + cd /opt/planetstack function ensure_postgres_running { @@ -44,6 +46,10 @@ function dropdb { function syncdb { echo "Syncing OpenCloud services..." python /opt/planetstack/manage.py syncdb --noinput + if [[ $DJANGO_17 ]]; then + echo "Loading initial data from fixture..." + python /opt/planetstack/manage.py loaddata /opt/planetstack/core/fixtures/initial_data.json + fi } function evolvedb { echo "Evolving OpenCloud services..."