0

So I am using a custom user model accounts.player and i'm also using django-registration in my project.

With the custom model it now encounters an error. I know I could just write my own registration code but is there a way to use the custom model class with django-registration. I had a look on the docs but didn't really find a solution.

I'm sure theres probably a way using something like a subclass but i'm not sure how to implement this.

What files are required and what code would I need??

Callum
  • 1,136
  • 3
  • 17
  • 43

2 Answers2

0

This is what I did for a personal project of mine:

class UserProfile(models.Model):

    user = models.OneToOneField(User, related_name = 'MoreAboutUser', unique=True)
    age = ....
    gender = ....

Regarding your error, I don't know how to help you since you didn't provide any traceback/code. But you can connect your custom model with the User model with a OneToOneFiel'

Mihai Zamfir
  • 2,167
  • 4
  • 22
  • 37
0

You could either Fork django-registration and make changes to Make it work with Custom User model... But that would be a long process...

Or

You could switch to django-allauth , which is a better and well maintained Registration app for Django. It is compatible with Latest django version and also provides social registration out of the box

Sahil kalra
  • 8,344
  • 4
  • 23
  • 29