Django迁移大文件

时间:2018-07-09 21:52:26

标签: python django django-models django-migrations

我正在尝试对包含近百个类的大型models.py文件进行makemigration。命令manage.py makemigrations <app_name>给了我MemoryError。我认为这与大型models.py文件有关。

File "/home/venv_two/local/lib/python2.7/site- 
packages/django/core/management/commands/makemigrations.py", line 231, 
in write_migration_files migration_string = writer.as_string()

File "/home/venv_two/local/lib/python2.7/site- 
packages/django/db/migrations/writer.py", line 166, in as_string
items["operations"] = "\n".join(operations) + "\n" if operations else ""
MemoryError

0 个答案:

没有答案