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

408 views
Skip to first unread message

Tejinder Singh

unread,
Feb 1, 2013, 6:28:01 AM2/1/13
to django...@googlegroups.com
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.

Witold Greń

unread,
May 27, 2013, 6:47:13 AM5/27/13
to django...@googlegroups.com
I have the same problem.
How to solve it?

Joey Espinosa

unread,
May 27, 2013, 6:55:53 AM5/27/13
to django...@googlegroups.com
Do you have "profiles" in INSTALLED_APPS?

--
Joey "JoeLinux" Espinosa



--
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...@googlegroups.com.
To post to this group, send email to django...@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.
 
 

Juan Francisco Roco

unread,
May 27, 2013, 11:45:47 AM5/27/13
to django...@googlegroups.com
Sorry, double post I don't see my answer published:

I found this in stackoverflow:


After syncdb:

$ ./manage.py migrate
$ ./manage.py convert_to_south app

You will got:

CommandError: One or more models did not validate:
auth.user: Model has been swapped out for 'app.MyUser' which has not been installed or is abstract.

Create a fake migration:

./manage.py migrate app 0001 --fake

Change your models:

./manage.py schemamigration app --auto

./manage.py migrate app

It should work!!!

('django.contrib.auth', must be in INSTALLED_APPS)

Witold Greń

unread,
May 27, 2013, 11:54:04 AM5/27/13
to django...@googlegroups.com
thanks, it works :)


2013/5/27 Juan Francisco Roco <jfr...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/cgR4R63m0DM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@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.
 
 



--
Pozdrawiam:
Witold Greń
Reply all
Reply to author
Forward
0 new messages