title: Create django super user in a docker container without inputting password
body: <p>I am tring to createsuperuser in a django docker container with fabric.</p>
  
  <p>To create the super user in django, I need run this in a django interactive mode:</p>
  
  <pre><code>./manage.py createsuperuser
  </code></pre>
  
  <p>And because I want to make it run in a fabric script, so I find <a href="http://source.mihelac.org/2009/10/23/django-avoiding-typing-password-for-superuser/" rel="noreferrer"><strong>this</strong></a> command could avoid inputing password </p>
  
  <pre><code>echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'pass')" | ./manage.py shell
  </code></pre>
  
  <p>Then I put this together with <strong>"docker exec"</strong> to run it in my django container</p>
  
  <pre><code>docker exec container_django echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'pass')" | ./manage.py shell
  </code></pre>
  
  <p>The problem comes out with the linux pipe, the pipe(|) all the contents on its left(including the docker exec) to its right(./manage.py shell)</p>
  
  <p>And this is not only difficult part, considering to put all these junks into a fabric run, which means they need quotes on both end. It will make whole thing very urgly. </p>
  
  <pre><code>fabric run:
  run("docker exec container_django {command to create django super user}")
  </code></pre>
  
  <p>I am still struggling on how to make at least the junk work in a fabric run, but I don't know how to do it.</p>