Re: Is a Custom User Model worth the headache?

2020-02-15 Thread Mike Dewhirst
Thank you kind sir Makes perfect sense ...Mike
 Original message From: Carsten Fuchs  
Date: 15/2/20  23:33  (GMT+10:00) To: django-users@googlegroups.com Subject: 
Re: Is a Custom User Model worth the headache? Hi Mike,Am 2020-02-14 um 23:30 
schrieb Mike Dewhirst:> In your documentation you mention "from accounts.models 
import User"> > I have been maybe taking things too literally. After migrating 
to my custom user I have used "from django.contrib.auth import get_user_model" 
followed by "User = get_user_model"> > I much prefer your direct route. Is it 
correct?Yes, I think so. As I wrote near the top, every code that is to be used 
by others must use the generic referencing method, so that it can deal with 
whatever User model the client code uses.In your project apps that are not 
intended for reuse by other "foreign" code, there is, imho, no need to use the 
additional redirection that the generic referencing methods bring. You can just 
import your custom user model there directly.Best regards,Carsten-- 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+unsubscr...@googlegroups.com.to view this 
discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7a50241-afba-cd3d-0ab2-08795a87a2d6%40cafu.de.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5e486d55.1c69fb81.b393e.2244SMTPIN_ADDED_MISSING%40gmr-mx.google.com.


Re: Is a Custom User Model worth the headache?

2020-02-15 Thread Carsten Fuchs
Hi Mike,

Am 2020-02-14 um 23:30 schrieb Mike Dewhirst:
> In your documentation you mention "from accounts.models import User"
> 
> I have been maybe taking things too literally. After migrating to my custom 
> user I have used "from django.contrib.auth import get_user_model" followed by 
> "User = get_user_model"
> 
> I much prefer your direct route. Is it correct?

Yes, I think so. As I wrote near the top, every code that is to be used by 
others must use the generic referencing method, so that it can deal with 
whatever User model the client code uses.

In your project apps that are not intended for reuse by other "foreign" code, 
there is, imho, no need to use the additional redirection that the generic 
referencing methods bring. You can just import your custom user model there 
directly.

Best regards,
Carsten

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7a50241-afba-cd3d-0ab2-08795a87a2d6%40cafu.de.


Re: Is a Custom User Model worth the headache?

2020-02-14 Thread Mike Dewhirst

On 14/02/2020 7:32 pm, Carsten Fuchs wrote:

Am 14.02.20 um 09:03 schrieb Mike Dewhirst:

Definitely start a new project with a custom user and I would consider aborting 
an existing project to restart with a custom user if it was started with the 
standard user.

Which may not be possible for large, existing projects.

Switching to a custom user model in mid-project is possible. Based on the work 
of other's, I've tried to summarize the required steps, see 
https://code.djangoproject.com/ticket/25313#comment:18 for details.

For new projects, consider 
https://django-improved-user.readthedocs.io/en/latest/ (rationale: 
https://django-improved-user.readthedocs.io/en/latest/rationale.html )

Best regards
Carsten



Well documented Carsten!!! Many thanks. Also, I really liked 
django-improved-user and was able (having endured the retro-fitting 
pain) to adjust last_name/first_name to full_name/short_name. That was 
an immediate payoff.


In your documentation you mention "from accounts.models import User"

I have been maybe taking things too literally. After migrating to my 
custom user I have used "from django.contrib.auth import get_user_model" 
followed by "User = get_user_model"


I much prefer your direct route. Is it correct?

Thanks

Mike


--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3a78b205-ca7e-75f4-f78c-94c46e61bf06%40dewhirst.com.au.


Re: Is a Custom User Model worth the headache?

2020-02-14 Thread maninder singh Kumar
It really depends on what you want to do with your user authentication

Sent from my iPad

> On 14-Feb-2020, at 2:02 PM, Carsten Fuchs  wrote:
> 
>> Am 14.02.20 um 09:03 schrieb Mike Dewhirst:
>> Definitely start a new project with a custom user and I would consider 
>> aborting an existing project to restart with a custom user if it was started 
>> with the standard user.
> 
> Which may not be possible for large, existing projects.
> 
> Switching to a custom user model in mid-project is possible. Based on the 
> work of other's, I've tried to summarize the required steps, see 
> https://code.djangoproject.com/ticket/25313#comment:18 for details.
> 
> For new projects, consider 
> https://django-improved-user.readthedocs.io/en/latest/ (rationale: 
> https://django-improved-user.readthedocs.io/en/latest/rationale.html )
> 
> Best regards
> Carsten
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/5aabf51c-aa69-5210-d2c1-252173f012d6%40cafu.de.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2A457431-AE3C-4274-B3E0-3CE778A4A96B%40gmail.com.


Re: Is a Custom User Model worth the headache?

2020-02-14 Thread Carsten Fuchs
Am 14.02.20 um 09:03 schrieb Mike Dewhirst:
> Definitely start a new project with a custom user and I would consider 
> aborting an existing project to restart with a custom user if it was started 
> with the standard user.

Which may not be possible for large, existing projects.

Switching to a custom user model in mid-project is possible. Based on the work 
of other's, I've tried to summarize the required steps, see 
https://code.djangoproject.com/ticket/25313#comment:18 for details.

For new projects, consider 
https://django-improved-user.readthedocs.io/en/latest/ (rationale: 
https://django-improved-user.readthedocs.io/en/latest/rationale.html )

Best regards
Carsten

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5aabf51c-aa69-5210-d2c1-252173f012d6%40cafu.de.


Re: Is a Custom User Model worth the headache?

2020-02-14 Thread Mike Dewhirst
I agree. The custom user will be essential for you one day and the pain 
of retrofitting it is hard.


I have done a retrofit and don't recommend it unless you have no other 
choice.


Definitely start a new project with a custom user and I would consider 
aborting an existing project to restart with a custom user if it was 
started with the standard user.


Good luck

Mike

On 13/02/2020 9:08 pm, SikoraD wrote:

Hi Ben,

I'll highly recommended to read fantastic post on Will Vincent 
 blog -> 
https://wsvincent.com/django-tips-custom-user-model/
His approach is much easier than one on django website and it is worth 
to have look.


Also his djangox repo on github is very useful.

Best Regards
Damian


Hi.

I read the part where it's "highly recommended" to create a custom
user model, but I don't see why it's worth the headache.  I found
these problems:

1 In the admin panel, my auth groups are in a separate app from my
users
2 There is some disagreement out there about how apps should refer
to a user model now that the user model might be custom
3 A lot of features that I would add are app specific, and
therefore would be better handled by app specific profiles
4 There's a new entry point for possible errors and glitches

So why do this?

Thanks,
Ben

--
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+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b3d9cbf-4637-4d77-9cd4-94f12098debe%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8cfcc769-7e72-0c18-2d2f-825cd97730e0%40dewhirst.com.au.


Re: Is a Custom User Model worth the headache?

2020-02-13 Thread maninder singh Kumar
Here's my opinion on this :
1. It requires the.user model to be the first migration
2.  You could either want to extend or customise the User model
3.  If extending is all you want then use the default authentication

I tried customising it didn't find it worth my time

Willy

Sent from my iPad

> On 13-Feb-2020, at 9:00 PM, bnmng  wrote:
> 
> Thanks for the reply.  That is a good post and I'll go along with the 
> recommendation, though I still don't completely understand why adding a 
> profile isn't as good as creating a custom user, and I wish I could figure 
> out how to group custom users and auth groups together in the same admin 
> section
> 
> Ben 
> 
>> On Thursday, February 13, 2020 at 8:04:18 AM UTC-5, SikoraD wrote:
>> Hi Ben,
>> 
>> I'll highly recommended to read fantastic post on Will Vincent blog -> 
>> https://wsvincent.com/django-tips-custom-user-model/
>> His approach is much easier than one on django website and it is worth to 
>> have look.
>> 
>> Also his djangox repo on github is very useful.
>> 
>> Best Regards
>> Damian
>> 
>> 
>>> Hi.  
>>> 
>>> I read the part where it's "highly recommended" to create a custom user 
>>> model, but I don't see why it's worth the headache.  I found these problems:
>>> 
>>> 1 In the admin panel, my auth groups are in a separate app from my users
>>> 2 There is some disagreement out there about how apps should refer to a 
>>> user model now that the user model might be custom
>>> 3 A lot of features that I would add are app specific, and therefore would 
>>> be better handled by app specific profiles
>>> 4 There's a new entry point for possible errors and glitches
>>> 
>>> So why do this? 
>>> 
>>> Thanks,
>>> Ben 
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/3210d917-e796-4b26-a316-fc3974bcfc0b%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F667FDD1-50AE-4E7B-A129-B12B363DB5C7%40gmail.com.


Re: Is a Custom User Model worth the headache?

2020-02-13 Thread bnmng
Thanks for the reply.  That is a good post and I'll go along with the 
recommendation, though I still don't completely understand why adding a 
profile isn't as good as creating a custom user, and I wish I could figure 
out how to group custom users and auth groups together in the same admin 
section

Ben 

On Thursday, February 13, 2020 at 8:04:18 AM UTC-5, SikoraD wrote:
>
> Hi Ben,
>
> I'll highly recommended to read fantastic post on Will Vincent 
>  blog -> 
> https://wsvincent.com/django-tips-custom-user-model/
> His approach is much easier than one on django website and it is worth to 
> have look.
>
> Also his djangox repo on github is very useful.
>
> Best Regards
> Damian
>
>
> Hi.  
>>
>> I read the part where it's "highly recommended" to create a custom user 
>> model, but I don't see why it's worth the headache.  I found these problems:
>>
>> 1 In the admin panel, my auth groups are in a separate app from my users
>> 2 There is some disagreement out there about how apps should refer to a 
>> user model now that the user model might be custom
>> 3 A lot of features that I would add are app specific, and therefore 
>> would be better handled by app specific profiles
>> 4 There's a new entry point for possible errors and glitches
>>
>> So why do this? 
>>
>> Thanks,
>> Ben 
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3210d917-e796-4b26-a316-fc3974bcfc0b%40googlegroups.com.


Re: Is a Custom User Model worth the headache?

2020-02-13 Thread SikoraD
Hi Ben,

I'll highly recommended to read fantastic post on Will Vincent 
 blog -> 
https://wsvincent.com/django-tips-custom-user-model/
His approach is much easier than one on django website and it is worth to 
have look.

Also his djangox repo on github is very useful.

Best Regards
Damian


Hi.  
>
> I read the part where it's "highly recommended" to create a custom user 
> model, but I don't see why it's worth the headache.  I found these problems:
>
> 1 In the admin panel, my auth groups are in a separate app from my users
> 2 There is some disagreement out there about how apps should refer to a 
> user model now that the user model might be custom
> 3 A lot of features that I would add are app specific, and therefore would 
> be better handled by app specific profiles
> 4 There's a new entry point for possible errors and glitches
>
> So why do this? 
>
> Thanks,
> Ben 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b3d9cbf-4637-4d77-9cd4-94f12098debe%40googlegroups.com.