title: Allow commands to run after backgrounding django runserver command in a bash script?
body: <p>I'm writing a 'simple' script to start up the django server, background it then start up firefox while I dev.</p>
  
  <p>I've seen the <a href="https://code.djangoproject.com/ticket/4996#trac-change-9-1288057753000000" rel="nofollow"><code>&lt;/dev/null &amp;</code></a> trick and that works on the command line. But when I use it in my script it still hangs on the server starting. Backgrounding with <kbd>ctrl-z</kbd> and the <code>bg</code> command only backgrounds the script and not the command.</p>
  
  <p>Is there a way I can pass django a 'Don't hog input' flag? Or I can background it inside the script in some way other than putting <code>&amp;</code> at the end of it? Or just tell the script not to run it all in a separate session?</p>
  
  <p>Here's my script in full (it's full on hard-core ugly, it might get prettified if I can get this to work):</p>
  
  <pre><code>SETTING_ENV=$1
  if [ "$PWD" = "/home/$USERNAME/PROJECT/" ]; then
      pid=$(for pid in $(pidof -x "python"); do ps -p $pid -o pid,cmd --no-heading; done| grep [m]anage|head -1|cut -d" " -f2)
      if [ -z $pid ]; then
          python ./manage.py runserver --settings=project.settings.$SETTING_ENV &lt; /dev/null &amp;
      else
          echo "Server still running on : $pid"
      fi
      pids=$(pidof -x firefox)
      for pid in $pids; do
          echo $pid
          if [ -z $pid ]; then
               echo "starting firefox"
               firefox --new-window localhost:8000 &amp;
          else ecjp "Firefox already running on pid: $pid"
          fi
      done
  else
      echo "$PWD is not /home/$USERNAME/PROJECT";
  fi
  </code></pre>