Why do I get a “auth_user does not exist”error when running “migrate” on a newly created django project with “registration redux” app installed?

前端 未结 6 1562
小鲜肉
小鲜肉 2021-02-20 10:57

Given a newly created django project with the following installed apps:

INSTALLED_APPS = (
\'django.contrib.admin\',
\'django.contrib.auth\',
\'django.contrib.co         


        
6条回答
  •  旧时难觅i
    2021-02-20 11:38

    Once you create a migration for your app it will automatically add the necessary dependencies. So in this case just run ./manage.py makemigrations registration.

    Please check the registration/migrations/0001_initial.py file and you should see something like this:

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]
    

    This means you need to create migrations for all your apps with any kind of dependency.

提交回复
热议问题