#!/bin/bash

pushd `dirname $0` > /dev/null
SCRIPTPATH=`pwd -P`
popd > /dev/null

ROOTPATH=$(readlink -m "$SCRIPTPATH/../../../..")
TMPFILE=`mktemp`

pushd "$ROOTPATH" > /dev/null

nohup bin/django testserver --noinput --addrport=0.0.0.0:8001 initial_data roles_generic test_suite > $TMPFILE 2>&1 &
echo "$!|$TMPFILE" > /tmp/testserver.pid

cat  /tmp/testserver.pid

popd > /dev/null
