【发布时间】:2016-09-18 09:18:38
【问题描述】:
我的项目结构如下:
bm_app_1
| contents here
bm_app_2
| contents here
bm_common
| __init__.py
| deletable
| | __init__.py
| | behaviors.py
| | models.py
| timestampable
| | __init__.py
| | behaviors.py
应用程序bm_common 中的文件定义了我想要在迁移文件中的托管模型。但是,当我运行python managepy makemigrations 时,不考虑应用程序bm_common 的子文件夹中的文件。所有应用都在INSTALLED_APPS
PREREQ_APPS = [
required apps here
]
PROJECT_APPS = [
'bm_common',
'bm_app_1',
'bm_app_2'
]
INSTALLED_APPS = PREREQ_APPS + PROJECT_APPS
有没有办法改变makemigrations 的行为来查看子文件夹?如果不是,那么进行这种拆分的好建议是什么?我不想将所有行为都集中在一个 behaviors.py 中,因为它变得太大并且对我造成了循环引用。
【问题讨论】:
标签: python django django-models django-migrations