Unable to migrate Django db when using docker container

On my Windows 10 machine, I am developing a database manager. Because the backend uses LDAP and the required development libraries are only available for Linux, I want to use Docker to set up an environment with the appropriate libs.

I managed to write a Dockerfile and compose file, that launch the (currently very basic) Django app in a Docker container with all the libs necessary.
I would like to play around with the django-ldapdb package and for that I want to apply the migrations.

  • Sharing docker registry images among gcloud projects
  • Docker 1.4.1 fails to start on Fedora 21: FATA[0000] EOF
  • How to create env-file in centos 7 for docker
  • Port mapping in Docker
  • how to setup a docker image on Arukas.io?
  • Docker Alpine nginx 403 Forbidden error for swagger-ui-builder
  • When I open PyCharm’s terminal and try to execute python manage.py migrate, I get an error telling me that the module ldapdb is not found. I suspect this is because the command does not use the remote Docker interpreter I set up with PyCharm.
    The other thing I tried is using PyCharm’s dedicated manage.py console. This does not initialize properly. It says the working directory is invalid and needs to be an absolute path, although the path it shows it the absolute path to the project.

    I have to admit that I have no idea how this remote interpreter works and I don’t see any Docker container running, so I might have not understood something properly here. I even tried running the app using PyCharm’s Django run config, which started a container, but still I get the same errors.

    I googled a lot, but I couldn’t find more infos about remote interpreters nor something solving my issue.

  • HAProxy with docker, consul and mesos, which one to choose?
  • Install yarn in a docker container says missing dependency
  • Docker communication without using legacy links
  • How to update config file through Dockerfile
  • Docker git clone on container launch?
  • ImportError: cannot import name <package> in pods while restarting pod fixes
  • One Solution collect form web for “Unable to migrate Django db when using docker container”

    The only way I managed to do this, is by executing the command inside the container.

    To get inside a container named contr, use the docker command

    docker exec -ti contr /bin/bash
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.