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

July 4, 2016, 2:19 a.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

5 from 5 (total 3 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

Artem Maltsev

Web-developer, having the knowlenge of programming language - Python, framework - Django, content management system - Django CMS, platform of e-commerce site - Django Shop and many other applications, using this technologies.

The right to use content on this page https://vivazzi.pro/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: Artem Maltsev
Link to article: <a href="https://vivazzi.pro/it/cannot-resolve-bases-for-pageuser/">https://vivazzi.pro/it/cannot-resolve-bases-for-pageuser/</a>

More: Terms of site usage

Comments: 2

Гость
Гость

18.08.2019 10:15 #

Огромная благодарность! Решение помогло.

Reply

Артём Мальцев
Артём Мальцев author

19.08.2019 4:27 #

Рад, что помогло!

Reply

You can leave a comment as an unregistered user.

But if you sing up, you can:

  • receive notifications
  • view your comments
  • be able to use all the functions of the developed services

To comment in one's own name you should log in or sign up on Vuspace website

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

Select currency for displaying monetary values