0

I have a few simple classes in my Django app that are not loading/importing properly. I know that the code works as I am Dockerizing over an existing app. I am fairly sure this is a similar issue to this but I do not know how to update this to use the Python inside my Docker container. I am following this guide (so all settings/configuration is the same).

I have 2 classes: a custom user class and a Company model, and I am trying to add a foreign key on the user that links it to a particular Company. On the other side, I will have a many to many relationships (a company can have multiple users).

from core.models import Company

VS Code says "unresolved import" when I hover on core.models

user1314147
  • 174
  • 1
  • 5
  • 25

1 Answers1

0

I figured out (kind of) how to fix the problem. This thread was helpful, I added a setting to ignore unresolved imports, I also reordered my imports, also I was opening the folder that contained my app code (the root where the docker-compose.yml file lives) but I needed to open the actual code/source directory.

Setting:
"python.analysis.disabled": [ "unresolved-import" ]

user1314147
  • 174
  • 1
  • 5
  • 25