Django Pluggable Apps, Migrations and Version Control

The goal: a plugable Django app, with migrations, where the migrations are stored in the repo of the plugable app. At first this might seem impossible because a plugable app does not have manage.py. Luckily for me, I always include a bare-bones django project in a folder called “example”. This project uses the plugable app. This means the migration code will be in the app repo.

The first step is to make the initial migration for the app:

python manage.py makemigrations my_app

after this command, you should see a migrations folder in your plugable app folder. Add those files to version control.

Next, update the plugable app in your projects and for each project, run migrate.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s