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 :

  • Getting 502 Bad Gateway while running the Django application within a docker container?
  • How do you set-up Mongo replica set on Kubernetes?
  • Docker on OSX: How to start boot2docker in one shell and use it in another
  • How to remove data from docker volume?
  • Get docker swarm manager node from jenkins job
  • Why does docker container prompt “Permission denied”?
  •   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.
    

  • Accessing resource over HTTPS in wordpress running on docker
  • How to sort by name `docker service ls`
  • Headless protractor not sharding tests
  • Multiple aerospike nodes on docker
  • How to set mysql username in dockerfile
  • Cloning gerrit project onto my host
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.