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.

  • NFS server into a docker container
  • How to stream multiple logs from docker container using log driver
  • Jenkins with Docker plugin java.lang.NullPointerException: uri was not specified
  • “Unable to access jarfile” when trying to run a jar with docker
  • Is there any reason to favour concatenated RUN directives over RUNning a script?
  • My docker container has no internet
  • 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.

  • Docker --volumes-from permissions
  • how to run kafka from docker landoop image
  • Consul-Agent architecture .. the node-id issue after upgrading to 0.8.1 - conceptual issue?
  • How to rename exported environment variable in docker
  • Script run inside docker container reporting significantly higher memory than outside
  • Docker: access to VPN domain from docker
  • 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.