Django 1.7 Migrations

前端 未结 4 676
时光取名叫无心
时光取名叫无心 2021-01-01 12:13

I am using django 1.7 and I just added a custom user model. When I run either python3 manage.py makemigrations or python3 manage.py migrate I get t

相关标签:
4条回答
  • 2021-01-01 12:21

    Had the same problem. I solved it with:

    pip install django --upgrade
    
    python manage.py makemigrations
    
    python manage.py migrate
    

    Why exactly it gets solved like that, I dont know, someone with deeper knowledge might be able to explain...

    0 讨论(0)
  • 2021-01-01 12:24

    Django 1.7.1 added support for the preserve_default param in AlterField. Therefore an upgrade of Django from version 1.7 will resolve the issue.

    pip install django --upgrade python manage.py migrate

    0 讨论(0)
  • 2021-01-01 12:25
    pip install "django<1.8" -U
    

    then run migrations.... If you update without versioning you'll end up with another active trunk and it's not what you want.

    0 讨论(0)
  • 2021-01-01 12:26

    I met the same problem. and I found my Django version is 1.7.0. After running pip install django --upgrade, my Django version changed to 1.7.4, and the problem is gone.

    I remember the other computer that sync the projects files with this one through Internet, has Django version 1.7.3. So I come to the conclusion that this problem is caused by inconsistent versions of Django.

    0 讨论(0)
提交回复
热议问题