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" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/bd88babe-684e-4b5a-8b90-86963c40ffd5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.