#!/usr/bin/env bash # run a script in the context of the django project export DJANGO_DEBUG="true" if [ -z $2 ]; then echo "Missing second argument : the path to the script" else oldcwd="$(pwd)" script_path=$2 echo "Starting $2 in a django shell:" echo -e "--------------------------------------------------------------------------------\n" cat "$script_path" | "$(pwd)/application/manage.py" shell echo -e "\n--------------------------------------------------------------------------------" cd "$oldcwd" fi