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
      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 manage.py reset_db
    

    It gives following error:

     Traceback (most recent call last):
     File "manage.py", line 10, in <module>
         execute_from_command_line(sys.argv)
         File "/usr/local/lib/python3.5/sitepackages/django/core/management/__init__.py", line 353, in execute_from_command_line
         utility.execute()
         File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
         self.fetch_command(subcommand).run_from_argv(self.argv)
         File "/usr/local/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
         self.execute(*args, **cmd_options)
         File "/usr/local/lib/python3.5/site- packages/django/core/management/base.py", line 399, in execute
         output = self.handle(*args, **options)
         File "/usr/local/lib/python3.5/site-  packages/django_extensions/management/utils.py", line 57, in inner
         ret = func(self, *args, **kwargs)
         File "/usr/local/lib/python3.5/site-packages/django_extensions/management/commands/reset_db.py", line 151, in handle
         cursor.execute(drop_query)
         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.