Have you tried something like *user = User.objects.get(username="username")*

On Saturday, 17 January 2015 00:00:32 UTC+8, joulumaa wrote:
>
> Hi,
>    
> If  user = auth.authenticate(username,password) results None, I would like 
> to create new user and login it.
> But I cannot find a way to determine easily if it is was None because of 
> 1) it was not in database or 2) it was in database but password was wrong
> I addition to those it may have been inActive or without permission, but 
> first thing to check would be to find if username is in user database.
> Is there any fast way to check it?
>
> -thanks for help
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5bc9220a-1383-4f52-a08a-59a1fd733889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to