Ask Your Question
2

Is it possible for me to instantiate AbstractUser within my model class located in model.py in django?

asked 2021-06-14 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-11-08 09:00:00 +0000

lakamha gravatar image

Yes, it is possible to instantiate AbstractUser within your model class located in models.py in Django. You can do this using the following code:

from django.contrib.auth.models import AbstractUser

class MyUser(AbstractUser):
    # add your custom fields and methods here

This creates a custom user model called MyUser that inherits from AbstractUser. You can then modify MyUser by adding your own custom fields and methods.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-06-14 11:00:00 +0000

Seen: 11 times

Last updated: Nov 08 '21