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 1546
小鲜肉
小鲜肉 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:47

    I think you needed to run:

    python manage.py syncdb

    and potentially you need to setup some dependencies? Probably not necessary after syncdb.

    South 1 style (Django < 1.7)

    class Migration:
    
        depends_on = (
            ("accounts", "0001"),
        )
    
        def forwards(self):
            ....
    

    South 2 style (Django >= 1.7)

    from django.db import migrations, models
    
    class Migration(migrations.Migration):
    
        dependencies = [("accounts", "0001")]
    

提交回复
热议问题