Friday, February 1, 2013

Can't convert app to south due to django 1.5 custom User model.

I have a custom app in my project named 'profiles' which contains a custom User model. Here is the declaration of the same:

class CustomUser(AbstractUser):
    image = models.ImageField(_('Image Field'), upload_to='user_images')

I have pointed this in my settings module, AUTH_USER_MODEL = 'profiles.CustomUser'

and in my settings i have 2 installed apps only, 1. South and 2. profiles.

when i do syncdb, everything seems to work fine, but when I django-admin.py convert_to_south profiles, it gives me following error:
Creating migrations directory at '/Users/tejinder/Projects/basidia/apps/profiles/migrations'...
Creating __init__.py in '/Users/tejinder/Projects/basidia/apps/profiles/migrations'...
 + Added model profiles.CustomUser
 + Added M2M table for groups on profiles.CustomUser
 + Added M2M table for user_permissions on profiles.CustomUser
Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate profiles
CommandError: One or more models did not validate:
auth.user: Model has been swapped out for 'profiles.CustomUser' which has not been installed or is abstract.

What could have been gone wrong? Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment