Extending the User model with custom fields in Django
- by Gaurav
I am trying to extend the User model so that I can add my own custom fields but I keep getting an error stating:
'NoneType' object has no attribute '_default_manager'
whenever I try to use
user.get_profile()
to add values to the custom field i.e. whenever I use it like so:
user = User.objects.create_user(username, email, password)
user.first_name = fname
user.last_name = lname
user.save()
uinfo = user.get_profile()
uinfo.timezone = "Asia/Pune"
uinfo.save()
I have already followed the steps given at
http://stackoverflow.com/questions/44109/extending-the-user-model-with-custom-fields-in-django/965883#965883 with no luck.