Sharing models between Django apps

后端 未结 4 999
你的背包
你的背包 2020-12-16 09:35

I will be brief: to work in the spirit and idea of a Django app, it is ok for an app to import models from inside another app ? Say, a User statistics app will import models

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-16 10:30

    Don't do this. They will have the same app name and the ORM will be confused. Use an abstract model instead, and have both derive from it.

提交回复
热议问题