Version controlled southern migrations in virtualenv

I have a Django site located in a folder site/. This is version control. I use South to migrate schemas and data for my applications. Applications for specific sites are located in the folder site/, so all of them are version controlled along with their migrations.

I run virtualenv to keep third-party components dry and safe. I install packages through PyPI. The list of installed packages is frozen in the .txt requirements file, so they can be easily installed in another environment. Virtualenv is not under VCS. I think this is a good way if virtualenv can be easily removed and restored at any time. If I need to test my site, for example, using a different version of the Python interpreter, just activate another virtulalenv.

I would like to use the South for third-party packages. This is where the problem arises. Migration scripts are stored in the application folder, so they are located outside my site repository. But I want the migration scripts to be versioned, so I can run them at different stages.

I do not want to manage versions of all virtualenv, but migration scripts for third-party applications. How can I resolve this conflict? Is there any misconception in my script?

+3
source share
2 answers

The SOUTH_MIGRATION_MODULES parameter allows you to place migration modules for the specified applications wherever you want (i.e. inside your project tree).

+1
source

I think it depends on your version control system. I recommend using a rare tree that only manages the transport folders of various packages. Here I see two alternatives:

  • , virtualenv. virtualenv, .

  • / . virtualenv , .

, , , , (easy_install/pip/whatever).

0

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


All Articles