I think your password is stored in plaintext. try using User.set_password
http://docs.djangoproject.com/en/dev/topics/auth/#passwords


On Mon, Feb 1, 2010 at 10:42 AM, tsmets <tsm...@gmail.com> wrote:

> I create in my model the Authors
>
>
> class Author(User):
>  """ An Author is someone more of less identified """
>  # TODO : Ensure that in fact the users are FK to the Django user
> management code
>  gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
>  persistance = models.ForeignKey(PersistanceDuration)
>
>  def __unicode__(self):
>    return u'%s %s --> user-id : %s (%s)' % (self.first_name,
> self.last_name, self.username, self.email)
>
>  class Admin:
>    list_display = ( 'username', 'email', 'first_name', 'last_name',
> 'gender', 'date_joined', 'last_login')
>    list_filter = ( 'username', 'email', 'first_name', 'last_name',
> 'gender')
>    ordering = ('username',)
>    search_fields = ( 'username', 'email', 'first_name', 'last_name',
> 'gender')
>
>  class Meta:
>    ordering = ['username']
>
> ****************************
>
> In the admin console I see Author I created and they are active.
> However when I try to authenticate with the following code (either in
> a django-shell or in the View):
>
> def login(request):
>  logging.fatal ('def login(request):')
>  if (request.method== 'POST'):
>    user = None
>    username = request.POST['username']
>    email = request.POST['email']
>    pwd = request.POST['password']
>    logging.fatal('Value received :\n\tusername : %s\n\te-mail : %s\n
> \tpassword : %s' % (username, email, pwd))
>
>    if username is not None :
>      user = authenticate(username=username, password=pwd)
>      ...
>
> ********************************************
> The user is always "None"...
>
> What do I do wrong ... ?
> It seems to me that everything is OK but the authenticate keeps on
> returning None !
>
>
> \T,
>
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
"The UNIX system has a command, nice ... in order to be nice to the other
users. Nobody ever uses it." - Andrew S. Tanenbaum

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to