Django shell mode in docker

I am learning how to develop Django application in docker with this official tutorial:

I have successfully run through the tutorial, and

  • How can you run a Docker container if it doesn't exist yet, or start it if it does?
  • Packer provisioning docker with chef-solo gets node name not found error
  • Can't connect nodejs and mysql in same docker
  • /sys on the host is becoming read-only once Docker is started
  • running a Sikuli (1.1.1) script on a docker (headless mode)
  • Docker - ELK stack — “Elasticsearch appears to be uneachable or down”
  • docker-compose run web startproject composeexample . creates the image
    docker-compose up runs the application

    The question is:

    I often use python shell to run Django in shell mode, but I do not know how to achieve that with docker.

  • docker deploy to docker for mac swarm mode not working, how to troubleshoot?
  • AWS EB should create new instance once my docker reached its maximum memory limit
  • run mysql:5.5 docker image from ansible
  • Is zap docker generate .xml report?
  • Does Docker override files?
  • Mounting directory in docker container and running Gradle command
  • One Solution collect form web for “Django shell mode in docker”

    1. Run docker exec -it --user desired_user your_container bash
      Running this command has similar effect then runing ssh to remote server – after you run this command you will be inside container’s bash terminal. You will be able to run all Django’s commands.
    2. Inside your container just run python shell
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.