Reputation: 36
I had been using auth.User user model. Now I changed my user model to custom.CustomUser. There were various models which were made during use of auth.User. So every tables in my database of mysql has created column name user_id or has constraint of foreign key with 'auth_user'. Due to which lots of problem are occuring. Everything other than this is working fine. AUTH_USER_MODEL is pointing to my 'custom.CustomUser' table and every new user is being stored in CustomUser. Is there any way of changing the reference of existing tables from auth_user to custom_customuser. I am using Django 1.7 which does not support south (As far as I know).
Upvotes: 0
Views: 98
Reputation: 14311
You'll need to update your models to point to settings.AUTH_USER_MODEL, as you mentioned. Here's an example:
your_field = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='yourmodel_yourfield')
Then, you'll need to use Django's internal migrations. Andrew Godwin, who wrote South, is now a core contributor to Django, so they should be fairly familiar to anyone using South:
Documentation: https://docs.djangoproject.com/en/1.8/topics/migrations/
If you're upgrading to 1.7, it is worth making the jump to 1.8 as well. You'll need to modify your TEMPLATE settings and urls.py patterns. 1.8 is a long term Django release. Good luck!
Upvotes: 0