Refactoring models from one django application to two

I have an application that has become too large, and I would like to split it into two parts. This is not an easy task with a code name, but I'm more afraid of the data migration that I will have to perform. Is there a proven way to do such things?

My current thoughts are:

  • Use south
  • Copying models to another application
  • Make data migration to copy the corresponding models from one application to another.
  • Make another migration that now removes unused models from the old application
  • You must execute a script that performs these operations in the correct order.

Has anyone done something like this?

+3
source share
1 answer

You do not need to migrate the database if you do not want to. Just set the db_tableMeta attribute on your models to refer to the old names and everything will be fine.

+2
source

Source: https://habr.com/ru/post/1773593/


All Articles