Django 1.7 conflicting models

后端 未结 2 1724
南方客
南方客 2020-12-10 10:29

I install my application in \"project/apps/myapp\" folder. Both apps and myapp folders have init.py files(Without any of them there is module missing error)

2条回答
  •  一生所求
    2020-12-10 11:04

    Instead of importing the all project then the app then the module inside the app just import the app which is inside the project then the module.

    Instead of

    from webproject.app import model
    

    Use

    from app import model
    

    or

    from app.models import Staffs
    

提交回复
热议问题