There is 1 other session using the database while resetting database in django using docker

I have been using docker with django. The app is up and running. But, when I changed the models and migrate it, the migrations is not being reflected in my database. So I am getting no column exists error :

      django.db.utils.ProgrammingError: column          ............_id does not exist

So, I want to reset the database and rerun makemigrations. But, When I run following commands :

  • Postrgesql running on coreos
  • Unable to find image 'xxxx' locally
  • Docker $(pwd) and bash aliases
  • How to upgrade elasticbeanstalk docker version
  • Setting up Nginx Proxy in Docker using Ansible
  • Docker Compose stuck downloading or pulling fs layer
  •   sudo docker-compose -f dev.yml run django python reset_db

    It gives following error:

     Traceback (most recent call last):
     File "", line 10, in <module>
         File "/usr/local/lib/python3.5/sitepackages/django/core/management/", line 353, in execute_from_command_line
         File "/usr/local/lib/python3.5/site-packages/django/core/management/", line 345, in execute
         File "/usr/local/lib/python3.5/site-packages/django/core/management/", line 348, in run_from_argv
         self.execute(*args, **cmd_options)
         File "/usr/local/lib/python3.5/site- packages/django/core/management/", line 399, in execute
         output = self.handle(*args, **options)
         File "/usr/local/lib/python3.5/site-  packages/django_extensions/management/", line 57, in inner
         ret = func(self, *args, **kwargs)
         File "/usr/local/lib/python3.5/site-packages/django_extensions/management/commands/", line 151, in handle
         psycopg2.OperationalError: database "postgres" is being accessed by other users
             DETAIL:  There is 1 other session using the database.

  • HostPath with minikube - Kubernetes
  • Does Apache Mesos + Marathon support LXD cluster management?
  • Generate TLS certificates for Docker for Windows
  • Docker, CoreOS and fleet based deployments
  • How can I use VOLUME in a Dockerfile to persist individual files in a directory?
  • How do I register logging driver for docker?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.