mysql - switch from auth_user to CustomUser in Django 1.7 -


i had been using auth.user user model. changed user model custom.customuser. there various models made during use of auth.user. every tables in database of mysql has created column name user_id or has constraint of foreign key 'auth_user'. due lots of problem occuring. other working fine. auth_user_model pointing 'custom.customuser' table , every new user being stored in customuser. there way of changing reference of existing tables auth_user custom_customuser. using django 1.7 not support south (as far know).

you'll need update models point settings.auth_user_model, mentioned. here's example:

your_field = models.foreignkey(settings.auth_user_model, related_name='yourmodel_yourfield') 

then, you'll need use django's internal migrations. andrew godwin, wrote south, core contributor django, should familiar using south:

documentation: https://docs.djangoproject.com/en/1.8/topics/migrations/

if you're upgrading 1.7, worth making jump 1.8 well. you'll need modify template settings , urls.py patterns. 1.8 long term django release. luck!


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -