Django user profile shared among different apps

44 views
Skip to first unread message

Gaurav Sahu

unread,
Jun 5, 2019, 8:53:45 AM6/5/19
to Django users
Hy Everyone,
I have a Django website which has multiple apps one of the apps is accounts app. accounts app is responsible for user sign up and authentication. Now I want to create a user profile in my website and that user will be the same across all of my web apps. how can I implement this?

Chetan Ganji

unread,
Jun 5, 2019, 10:27:19 AM6/5/19
to django...@googlegroups.com
just create another model in the accounts app and put a one to one key to the User Model of django. 
Import it from settings instead of harcoding it. Give it a relevant related_name.

Regards,
Chetan Ganji
+91-900-483-4183


On Wed, Jun 5, 2019 at 6:23 PM Gaurav Sahu <gaurav...@gmail.com> wrote:
Hy Everyone,
I have a Django website which has multiple apps one of the apps is accounts app. accounts app is responsible for user sign up and authentication. Now I want to create a user profile in my website and that user will be the same across all of my web apps. how can I implement this?

--
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/85bdf45d-ed9e-4a85-a9ce-df25e8b9e2c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gaurav Sahu

unread,
Jun 6, 2019, 7:49:19 AM6/6/19
to django...@googlegroups.com
I already have a model User which inherits Django user model. 
Screenshot from 2019-06-06 17-02-56.png
My question is do I have to create another model Profile which will have one to one relation with the Django user model? Or just delete my existing User model?

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/aNQbykpyi2E/unsubscribe.
To unsubscribe from this group and all its topics, 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.

For more options, visit https://groups.google.com/d/optout.


--

Chetan Ganji

unread,
Jun 6, 2019, 8:52:07 AM6/6/19
to django...@googlegroups.com
Yes. That's exactly you should do.

If you are not adding any extra attributes to the default django user model. You dont need the one thats shown above. 
Just use the default django user model. 


Regards,
Chetan Ganji
+91-900-483-4183

Reply all
Reply to author
Forward
0 new messages