title: Can't see django site being run in docker container on localhost
body: <p>I have a django app that I will need to deploy on Amazon's EC2 Container Service. In the meantime, in order to test the deployment, I am trying to deploy it in a docker container locally first, but even when running a simple demo django application, I am unable to see the page at localhost:8000.</p>
  
  <p>Here is my setup.</p>
  
  <p>Create a docker machine:</p>
  
  <pre><code>$ docker-machine create --driver virtualbox testmachine
  </code></pre>
  
  <p>After this I set up my environment:</p>
  
  <pre><code>$ eval "$(docker-machine env testmachine)"
  </code></pre>
  
  <p>I set up a Dockerfile for my test container:</p>
  
  <pre><code>FROM ubuntu
  
  RUN echo "deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main universe" &gt;&gt; /etc/apt/sources.list
  
  RUN apt-get update
  
  RUN apt-get install python-pip -y
  
  RUN pip install django
  
  RUN mkdir django_test
  
  RUN cd django_test &amp;&amp; \
      django-admin.py startproject django_test .
  </code></pre>
  
  <p>Then I call </p>
  
  <pre><code>$ docker build -t dockertest .
  ... builds successfully
  $ docker run -d -i -t -p 8000:8000 dockertest
  cbef144ac068eb61b0c3e032448cc207c8f0384a9a67a710df6d9beb26d2ab32
  $ docker attach cbef144ac068eb61b0c3e032448cc207c8f0384a9a67a710df6d9beb26d2ab32
  
  root@cbef144ac068:/# cd django_test
  root@cbef144ac068::/django_test# python manage.py runserver 0.0.0.0:8000
  </code></pre>
  
  <p>This successfully starts the server  at 0.0.0.0:8000/ of the container.</p>
  
  <p>However, when I try to go to localhost:8000 in my browser, I get a "This webpage is not available." What am I missing? </p>