Hi, I want add a new attribute in User model and create custom backends.
Steep by steep, I did the following:
1) I created an application named "profile" into my project
2) I created, in models.py of "profile" a class named "UserProfile",
which inherits
from User class of Django. I added "press_agency" attribute, and I wrote
objects = UserManager()
3) I registered UserProfile and UserProfileAdmin classes in admin.py, and
unregistered User of Django.
4) Into my project, I created auth_backends.py file. You should see it here:
http://dpaste.com/hold/101036/
5) In settings.py I wrote:
    AUTHENTICATION_BACKENDS = (
    'myproject.auth_backends.CustomUserModelBackend', )
   CUSTOM_USER_MODEL = 'myproject.profile.UserProfile'

Then, when I go to login, write mi name and password, y the system returns
the following error:
'NoneType' object has no attribute 'DoesNotExist'
Why? What is the problem?

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

Reply via email to