1.5 user abstract question

17 views
Skip to first unread message

frocco

unread,
Mar 26, 2013, 8:51:21 PM3/26/13
to django...@googlegroups.com
Hello

I need a couple of extra fields in my user model

Do I have to specify all fields in django user?

Is django user still used?

Rafael E. Ferrero

unread,
Mar 26, 2013, 9:20:59 PM3/26/13
to django...@googlegroups.com
Inherid from User Model

2013/3/26 frocco <far...@gmail.com>

--
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.





--
Rafael E. Ferrero
Claro: (03562) 15514856

Andreas Schosser

unread,
Nov 8, 2013, 10:59:09 AM11/8/13
to django...@googlegroups.com
Hi Frocco

> I need a couple of extra fields in my user model

You can connect a model in your app to the user model and add your
fields there.

Example myapp/models.py:
...
from django.contrib.auth.models import User
...
class Profile(models.Model):
user = models.OneToOneField(User, related_name='profile')
...

You can then access your data via "user.profile" in your views.

Hope that helps,
Andreas

--
Kurs 10 / IT-Consulting
Andreas Schosser a...@kurs-10.de

St.-Cajetan-Str. 13 Telefon +49 89 41615842-0
81669 München Telefax +49 89 41615842-3

0x6EDECCF1 - 2AA0 939B 5585 819B FCE8 E43B 0B8E 0DF2 6EDE CCF1

Vincenzo Prignano

unread,
Nov 8, 2013, 2:43:22 PM11/8/13
to django...@googlegroups.com
You can define your Custom User Model in your models.py (https://docs.djangoproject.com/en/1.6/topics/auth/customizing/#substituting-a-custom-user-model)
and then in your settings specify with AUTH_USER_MODEL = 'myapp.MyUser'
Reply all
Reply to author
Forward
0 new messages