I'm trying to use custom user model with Django CMS. I created new users app with this model:
users.models:
from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
    bio = models.TextField(max_length=500, blank=True)
    location = models.CharField(max_length=30, blank=True)
    birth_date = models.DateField(null=True, blank=True)
Here project settings:
settings:
INSTALLED_APPS = [
    'djangocms_admin_style',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.sites',
    'django.contrib.sitemaps',
    'django.contrib.staticfiles',
    'django.contrib.messages',
    'users',
    'cms',
    'menus',
    ...
]
AUTH_USER_MODEL = 'users.User'
Why I have this error?
manage.py makemigrations users
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'cms.PageUser'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies for more
                I ran into same problem and I followed your instruction but on step 9 I encounter this error: django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.
I got it to work by reordering your step (without commenting out the AUTH_USER_MODEL and without commenting out users from installed apps)
I ran into the same issue. Based on a reply to https://github.com/divio/django-cms/issues/3436 I did the following which worked for me:
AUTH_USER_MODEL bitmanage.py makemigrations
manage.py migrate
manage.py makemigrations users
manage.py migrate
I know it's an old post but it might help others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With