Answer the question
In order to leave comments, you need to log in
Django doesn't import model from parent folder, why?
I want to import the model, but it says SystemError: Parent module '' not loaded, cannot perform relative import I
import it this way:
What am I doing wrong, and how can I fix it? from ..models import Articles
Answer the question
In order to leave comments, you need to log in
Two dots mean you are moving up one folder hierarchy. I also recently encountered the same problem. I do not remember exactly, but the dock says about the prohibition to go beyond the package. Try replacing the dotted path with an absolute one - the folder with the application.models.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question