demux
demux

Reputation: 4654

How can I store 3rd party package migrations in a Django project?

I'm using the page module in feincms and when I add extensions to my settings I'd like to be able to store the migrations in my git repo.

There is some documentation on migrations in FeinCMS, but it looks incomplete, and I'm not able to get this working.

The file structure I have is:
- app
  - feincms_
    - migrate
      - __init__.py
    ...
  ...
settings.py
...
MIGRATION_MODULES = {
    'page': 'feincms_.migrate.page',
    'medialibrary': 'feincms_.migrate.medialibrary',
}
...

Upvotes: 1

Views: 540

Answers (1)

demux
demux

Reputation: 4654

Ok, silly me. I needed a directory with an __init__.py for each module.

i.e.
- app
  - feincms_
    - migrate
      - __init__.py
      - page
        - __init__.py
      - medialibrary
        - __init__.py
    ...
  ...

So to sum this up, in order to set the location for any module's migrations in Django, you have to specify a valid python path in MIGRATION_MODULES. This path can be anywhere you like, but you have to make sure that it exists.

Upvotes: 1

Related Questions