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.
Related Posts:
Comments: 2
18.08.2019 10:15 #
Огромная благодарность! Решение помогло.
Reply
19.08.2019 4:27 #
Рад, что помогло!
Reply