Custom user models and South

风流意气都作罢 提交于 2019-12-03 13:03:07

Try running ./manage.py migrate tournaments --fake 0001. This will add an entry into the south migration history saying that the initial migration has run, without actually executing the SQL. Alternatively, you can set class Meta: managed = False on the custom user object to tell django not to ever syncdb that model.

This worked:

  • Comment django.contrib.auth, django.contrib.admin and tournament (the app with my custom user model in settings.INSTALLED_APPS.
  • manage.py syncdb
  • Uncomment django.contrib.auth, django.contrib.admin and tournament
  • manage.py schemamigration tournaments --initial
  • manage.py syncdb
  • manage.py migrate tournaments

Quite hackey and terrible. Would love to know a better way.

I'm having the exact same problem, but I get the CommandError: even when I have my app in my INSTALLED_APPS, and uninstalled South. I did find a ticket on South for this, #1179, here. An anonymous poster had a similar work around as Thomas but a bit more complex. They do say that it is an issue with South and not Django, but I don't see how being I have uninstalled South, removed it from my INSTALLED_APPS and I still have the exact same error.

@dimadima It looks like Thomas' answer helped you but could you tell me which way worked for you and maybe accept his answer by clicking the check mark?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!