Doubt about Custom User Model

18 views
Skip to first unread message

pastrufazio

unread,
Jul 4, 2019, 4:58:00 AM7/4/19
to Django users
Hi!

I've read some examples about custom User Model. In all of them, it's suggested implement the class AbtractUser (in this case the app is called users)

For instance, in this example https://wsvincent.com/django-custom-user-model-tutorial/ they do


 users/models.py
from django.contrib.auth.models import AbstractUser
from django.db import models

class CustomUser(AbstractUser):
 


but then they say to include users.apps.UserConfig. Why? Where does it come from? Why not  the class users.apps.CustomUser ?



# djauth/settings.py
INSTALLED_APPS = [
...
'users.apps.UsersConfig', ]


Thank you very much



Jani Tiainen

unread,
Jul 4, 2019, 6:59:00 AM7/4/19
to django...@googlegroups.com
Hi 

Models always do belong to app. All apps do have AppConfig (one or more)

So when adding app (and thus models) to INSTALLED_APPS you need to point to which AppConfig you use (defined in apps.py)


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5bcb0c0a-c83f-4a67-97a7-325ef6ecc87b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages