2

I'm trying to setup FeinCMS but I have problems with Page migrations when I add or remove page extensions.

I've been following the docs, but no luck.

Here's my file structure:

testcms
├── cms
│   ├── __init__.py
│   ├── admin.py
│   ├── migrate
│   │   ├── __init__.py
│   ├── migrations
│   │   ├── __init__.py
│   ├── models.py
│   ├── tests.py
│   └── views.py
├── db.sqlite3
├── manage.py
└── testcms
    ├── __init__.py
    ├── models.py
    ├── settings.py
    ├── urls.py
    ├── wsgi.py

I've added the required settings in settings.py:

MIGRATION_MODULES = {
  'page': 'cms.migrate.page',
}

My INSTALLED_APPS looks like this:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    'cms',

    'feincms',
    'mptt',
    'feincms.module.page',
    'feincms.module.medialibrary',
)

When running ./manage.py makemigrations I get this error:

ImportError: No module named page

I tried with different folder structure and different MIGRATION_MODULES, but I didn't change anything.

The best I could get was "No changes detected".

Anyone has an idea what am I doing wrong? The CMS works fine, but I know I'm gonna need to make changes to Page model eventually.

Django version: (1, 8, 5, 'final', 0) FeinCMS version: (1, 11, 1)

Bartek
  • 21
  • 2

2 Answers2

1

Similar issue with Django 1.9 and Feincms 1.11.

The solution I received from Christopher Baines was to run migrate on the page and medialibrary modules directly. https://groups.google.com/forum/#!topic/django-feincms/pVACprn27Hw

First create an initial migration for FeinCMS:

python manage.py makemigrations --empty feincms

python manage.py migrate feincms

Then, run the migrations for each module:

python manage.py makemigrations page

python manage.py makemigrations medialibrary

python manage.py migrate page

python manage.py makemigrations

python manage.py migrate
leo
  • 455
  • 2
  • 9
0

Most likely the "page" module in the import error refers to the cms.migrate.page module that you defined in your MIGRATION_MODULES setting, not the feincms.page module.

Since you defined a custom migration module in MIGRATION_MODULES, you have to create the module yourself.

Make sure the directory cms/migrate/page exists and contains an __init__.py file.

Chris Hughes
  • 1
  • 1
  • 1