Env: Django 1.5.1 + Django CMS 2.4.1 + Zinnia latest + my custom apps + custom Django CMS plugin
Basically I can extend the default Django (1.5.X) User model like Django Ribbit Tutorial on NetTuts+
or
Substitute a completely customized model like Django Dev doc or Django2Scoops example in the paragraph: "Dealing With the User Model"
To test I decided for Subclass AbstractUser From Django2Scoops book:"Choose this option if you like Django’s User model fields the way they are, but need extra ..fields."
But I have the following errors:
notification.noticesetting: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL. cmsplugin_zinnia.latestentriesplugin: 'authors' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
cms.pageuser: 'created_by' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL. cms.pageusergroup: 'created_by' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
After hours of reading and test I found
Specifying custom User model (extends AbstractUser) doesn't work
As the error message says -- you need to update the relation to point at settings.AUTH_USER_MODEL. The second error ("Model has been swapped out…") is a side effect of the fact that you're directly referencing the User model. Once you change the ForieignKey references, this third error will go away. We've done everything we can to ensure a smooth transition to the new User model, but it can't be completely transparent. App writers will need to update their apps to be 1.5 compatible. Essentially, a Django 1.4 app won't be 100% compatible with Django 1.5 if it contains a hard-coded foreign key reference to User. Please, could you give me more examples?
And Django/Python: Update the relation to point at settings.AUTH_USER_MODEL
in settings_example.py you have AUTH_USER_MODEL = 'users.User'. However you are using an app - menu.bookmark - that has a relation to django.contrib.auth.User - you can't have both. Setting AUTH_USER_MODEL means that you are replacing the built-in Django user model with your own. See http://procrastinatingdev.com/django/using-configurable-user-models-in-django-1-5/ for details.
But I don't understand how can I solve this.
What I would need:
-Users are linked to Institutes Class (one institute -> more users)
-Users or Institutes can have different permission and see different django cms pages/plugin.
-Several more fields for User.
Is Subclass AbstractUser the correct point?
How can I solve the "swapped out" error?
I should create something similar to OpenTreeMap Code
Isn't deprecated this code?
Thanks!