Django 1.7 data migration for custom user model

后端 未结 2 1958
南笙
南笙 2021-01-07 15:21

I have created a custom user model for my project. I have written a data migration file to copy contents of auth.User to my new custom user table. It doesn\'t seem to work p

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-07 15:47

    You should set AUTH_USER_MODEL = 'auth.User' in settings.py before run this migrate and after this migrate finishes, update the settings.py to AUTH_USER_MODEL = 'custom_auth.User'

提交回复
热议问题