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 1588
小鲜肉
小鲜肉 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条回答
  •  旧巷少年郎
    2021-02-20 11:42

    The problem is avoided when you do as Pedro Wagner suggests (auth_user error with Django 1.8 and syncdb / migrate):

    Make sure that for all your apps, there exist initial migrations files by running:

    manage.py makemigrations my_app
    

    I'd do it not only for those that depend on auth because I think the problem is more general.

    The root cause for this behaviour seems to me that for some reason

    manage.py makemigrations
    

    does not always create the initial migrations if they are not already there, contrary to:

    manage.py makemigrations my_app
    

    Unfortunately I cannot fathom the reasons for this asymmetry.

提交回复
热议问题