The original post was in 2013 and today is 2016.
I had the same problem as yours and I managed to find a solution. 
In case anyone is still wondering on how to tackle this problem, here is my 
solution. 

from django.apps import apps

User = apps.get_model(app_label=yourapplabel, model_name=yourmodelname)

now you can use the generic User model without settings.AUTH_USER_MODEL 


On Wednesday, October 9, 2013 at 6:16:58 AM UTC+8, Burak Emre Kabakcı wrote:
>
> It would be nice if you allow using two different models for 
> django.contrib.auth module. The current User model is great for admin panel 
> users but in frontend it may become extra overhead for some cases. People 
> try to create another user attribute models and use extra joins to be able 
> to keep extra attributes (city, ip, locale etc.) for their users.
>
> It seems there are a lot of improvements in Django 1.5 I think there are 
> more thing that may be revised. For example I think we should be able to 
> set AUTH_USER_MODEL setting per module basis or namespaced routes basis.
>
> In order to solve this issue I needed to create a middleware class to 
> change settings.AUTH_USER_MODEL; however I know that this is not the ideal 
> solution because in each request I need to re-set one of the static Django 
> settings. Here is the middleware class:
>
> class ChangeBaseUser(object):
>     def process_request(self, request):  
>         match = resolve(request.path)
>         if match.app_name == "myapp":
>             settings.AUTH_USER_MODEL = 'myapp.Customer'
>         else:
>             settings.AUTH_USER_MODEL = 'auth.User'
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f62d26d9-1faf-43da-af74-3cf713deedb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to