InvalidBasesError: Cannot resolve bases for [<ModelState: 'cms.PageUser'>]

July 3, 2016, 10:19 p.m.

If you get this error:

django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'cms.PageUser'>]

Then the problem is in 0001_initial.py migration of django cms. This migration try to refer to migrations of User model:

class Migration(migrations.Migration):

    dependencies = [
        ('auth', '__first__'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),  # refer to migrations of User model
        ('sites', '__first__'),
    ]
    ...

And doesn't find, because there aren't migrations yet for our model of custom user. So before the creations of migrations you need comment djangocms_text_ckeditor and cms applications in settings.py:

INSTALLED_APPS = (
    ...
    'django.contrib.auth',
    'my_custom_auth',  # our custom User model
    ...

    # 'djangocms_text_ckeditor',
    # 'cms',
    ...
)

Run makemigrations:

manage.py@my_project > makemigrations

Migrations for 'my_custom_auth':
  0001_initial.py:
    - Create model User

And then remove comment for djangocms_text_ckeditor and cms applications. That's all.

Rate this article

0 from 5 (total 0 ratings)

You can send feedback, suggestions or comments on this article using this form:

Fields marked by star ( * ) is required.

Thank you for yor feedback!

After clicking the "Send" button, your message will be delivered to me on the mail.

Author of Article

The right to use content on this page http://vivazzi.pro/en/it/cannot-resolve-bases-for-pageuser/:

Permission is granted to copy an content with its author and reference to the original without using the parameter rel="nofollow" in tag <a>. Usage:

Author of Article: Maltsev Artem
Link to article: <a href="http://vivazzi.pro/en/it/cannot-resolve-bases-for-pageuser/">http://vivazzi.pro/en/it/cannot-resolve-bases-for-pageuser/</a>

More: Terms of site usage

Comments: 0

You can leave a comment as an unregistered user. But by registering, you will be able to receive notifications of replies, and also have access to your personal account to view your comments.

To comment in one's own name you should log in or sign up in the usual way or through social networks:

Send

There is no search on this site, so I offer to use usual search engine, for example, Google, adding "vivazzi" after your request.

Try it