F
F
fsociety02021-02-15 20:34:27
Django
fsociety0, 2021-02-15 20:34:27

What is the error ImportError: attempted relative import beyond top-level package?

File "", line 5, in
from ..books.models import Comment
ImportError: attempted relative import beyond top-level package


There is application 1 and application 2. I am trying to import a model from application 1 into the forms.py file (application 2).
from ..app1.models import Model
I get an incomprehensible error, I can’t google anything Project
structure
pPZ3Y.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2021-02-15
@bacon

from app1.models import Model

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question