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

  • Which is the best way to pass AWS credentials to Docker container?
  • run docker on overlay network failed
  • docker service replicas remain 0/1
  • Django Docker settings with link and enviroment
  • My docker container isn't starting on localhost ( on Docker for Windows (Native using Hyper-V)
  • dockerize a wpf application and use it
  • 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.

  • Managing remote docker machines from multiple development machines
  • nginx windows 10 upstream timeout
  • Exposing a WSGI app from a Docker container
  • AWS Elastic Beanstalk is ignoring my file
  • Docker and NodeJS permission denied
  • What are the advantages of docker containers over statically linked EXEs?
  • 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.