Btw, yes I am aware of the paragraph below explaining the confusing
dilemma. That's how I fixed my issue. Thank you Santiago.

On Sep 23, 5:02 pm, Yo-Yo Ma <[email protected]> wrote:
> It is a problem with Django. I thought it was a problem with the code
> but it isn't. It's a problem with the documentation, or worse. An
> function of an API that requires running of another function to alter
> an object behind the scenes is an architectural problem that needs
> fixing. Seehttp://www.joelonsoftware.com/articles/LeakyAbstractions.html
> - and furthermore, if the choice is made to leave problems like this
> unfixed, they should be documented as so. The current documentation
> here says, "It takes an HttpRequest object and a User object.". This
> isn't true, as as simple User object will not suffice. It should say,
> "It takes an HttpRequest object and a User object that has been run
> through the function authenticate() first to alter the auth backends
> that are attached as attributes to it.".
>
> This has very bad code smell, IMHO.
>
> On Sep 23, 3:47 pm, "David P. Novakovic" <[email protected]>
> wrote:
>
> > This probably should have been posted to django-users anyway.
>
> > Chances are, getting a stacktrace like this one or the last error you
> > posted are actually problems with your code and not django itself.
>
> > Unless you can show that it is actually a problem with django and not
> > the way you are using it, it'd be better addressed on django-users
> > first.
>
> > David
>
> > On Fri, Sep 24, 2010 at 5:41 AM, Jacob Kaplan-Moss <[email protected]> 
> > wrote:
> > > On Thu, Sep 23, 2010 at 2:18 PM, Yo-Yo Ma <[email protected]> 
> > > wrote:
> > >> Hey Jacob, understood. Here's some more details that might help:
> > > [snip]
> > >>                if user.check_password(request.POST.get('password',
> > >> '')):
> > >>                    login(request, user)
>
> > > As Santiago mentioned, you need to call authenticate() before calling
> > > login(). 
> > > Seehttp://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth...
> > > for details.
>
> > > Jacob
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django developers" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to 
> > > [email protected].
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/django-developers?hl=en.

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

Reply via email to