# waiting for other network services
sh $app/scripts/wait.sh
-
-# django setup
python $manage wait-for-db
-python $manage syncdb --noinput
-python $manage migrate --noinput
-python $manage bower_install -- --allow-root
-python $manage collectstatic --noinput
-# telemeta setup
-python $manage telemeta-create-admin-user
-python $manage telemeta-create-boilerplate
+# initial setup
+if [ ! -f .init ]; then
+ bash $app/scripts/init.sh
+ touch .init
+fi
+
+python $manage bower_install -- --allow-root
+ # Delete Timeside database if it exists
+ cat /srv/src/telemeta/scripts/sql/drop_timeside.sql | python $manage dbshell
+
if [ $REINDEX = "True" ]; then
python $manage rebuild_index --noinput
fi