0

As i am importing models from other app by from projectname.app1.models import model1

it says for projectname.app1 ModuleNotFounderror

https://i.stack.imgur.com/mYuIS.jpg

Gayatri
  • 1
  • 1
  • What version of django are you using? Also, can you post the exact error? – nnyby Aug 30 '18 at 18:45
  • Django 2.1 And error is ModuleNotFoundError: no module named "project.app1" ,as I am importing: from project.app1.models import model1 – Gayatri Aug 31 '18 at 14:38

1 Answers1

0

I got the answer.

For recent Django There is no need to write import (while using models of other app) Eg. Suppose in app1 I am having user model. In app2, article model. In article model using user as foreign key as, user= models.ForeignKey('app1.user', on_detele= models.CASCADE)

Gayatri
  • 1
  • 1