Migration from MySQL to postgresql using Django and Docker – relation “authtoken_token” does not exist

I am trying to migrate my Django project using MySQL database to postgresql with Docker. When I use MySQL everything works fine. I have all in ORM so when I use MySQL I have to create only database and do python manage.py makemigrations and then python manage.py migrate and I get ready database with all relations. As I have mentioned I’m trying to use postgresql database. Server seems to work fine using docker-compose up, but when I send for instance GET request I get:

ProgrammingError at /data
relation "authtoken_token" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "authtoken...

My settings:

  • Deis docker image deploy
  • Bash with docker exec don't go down when there's more content to show
  • Gitlab-CI multi runner start docker container, scripts now work
  • Docker windows with hyper-v example baffles me??? Why does the alpine example not work they way I thought it would?
  • SymmetricDS Postgres target gives “Failed to read table” for all sym_* tables
  • How to create a MongoDB docker and save the DB's configuration?
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'NAME': 'postgres',
            'USER': 'postgres',
            'HOST': 'db',
            'PORT': 5432,

    My docker-compose.yml:

    version: '3'
        image: postgres
        build: .
        command: python3 DIR/backend/dir/manage.py runserver
          - .:/code
          - "8000:8000"
          - db


    FROM python:3.6.1
    RUN mkdir /code
    WORKDIR /code
    ADD requirements.txt /code/
    RUN pip3 install -r requirements.txt
    ADD . /code/
    CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
    f364a72186ce        dockerpri_web       "python3 PROJECT/backe..."   19 seconds ago      Up 18 seconds>8000/tcp   dockerpri_web_1
    774ae20bcaa3        postgres            "docker-entrypoint..."   9 hours ago         Up 19 seconds       5432/tcp                 dockerpri_db_1
    MacBook-Pro:DockerPROJECT myName$ docker exec -ti dockerproject_web_1 /bin/bash

  • Saving docker container image
  • dockerd init script in fedora
  • Docker error: HTTP 408 response body: invalid character '<' looking for beginning of value
  • Docker container disaster recovery
  • How to run Percona XtraDB Cluster with external data directory?
  • Docker> postgresql9.6 error
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.