Monday, October 24, 2022

Re: User model override and authentication

If I may ask: why do you want to do this? If you just want to change what's displayed on Django Admin for example, you can do that without messing up with the code.

On Tue, Oct 25, 2022 at 2:48 AM Ayser shuhaib <embedded.manager@gmail.com> wrote:
Oi Rafael

I'm sure this tutorial will help you:


On Mon, 24 Oct 2022 at 23:14, Rafael Noronha <rafaelsnoronhag@gmail.com> wrote:
Hello guys,
I'm not advanced in Django and would like to know how and if it's possible to do it.

I need to override Django's user model, and change the fields "username" to "sr_usuario" and "password" to "sr_password", but I would like to continue using all Django's default authentication scheme and permissions. I want not only to change the description in the database or a label, I want to change the name of the field in the model, for when for example I needed to make a query, I would use User.objects.filter(sr_usuario="user_name") and everything would work usually.

It's possible? I couldn't find anything in the documentation or on forums I've searched.

Thank you very much in advance!

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/101d09bb-b076-4e54-9cbc-776ff93c979fn%40googlegroups.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE0AZGKackLiX%2B83RPyNfHr9gLFX%3DYwrdrKM40tcwBPR48zjWQ%40mail.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAORpQohaf_bYGA3VjjbmFCj%2BAC9hpt6aqhgwiHHRVLmFxm01oQ%40mail.gmail.com.

No comments:

Post a Comment