A
A
Alexander2016-04-05 09:49:17
Django
Alexander, 2016-04-05 09:49:17

Django won't import my model?

models.py

from django.db import models
from news.models import New

......

Terminal:
......
 File "/home/alexander/my_project/poliv/news/models.py", line 3, in <module>
    from tour_category.models import TourCategory
  File "/home/alexander/my_project/poliv/tour_category/models.py", line 2, in <module>
    from news.models import New
ImportError: cannot import name 'New'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marazmiki, 2016-04-05
@kentuck1213

Cyclic dependencies, perhaps? In news/models.py do you import models from tour_category/models.py and vice versa?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question