Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » authenticate problem with multiple db ? [RSS Feed]

#1 June 23, 2010 18:25:43

K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

authenticate problem with multiple db ?


Hi,
when authenticate is called i get this errorhttp://dpaste.com/210674/though the user exist in database... is authenticate known to not work
with multiple database context ?

my register function was working fine before that...
i've tried with @transaction.autocommit in place of
@transaction.commit_on_success
to ensure the creation of the user before authenticate is called.

here is the function :
@transaction.autocommit
def register(request,template_name='accounts/
register.html',template_name_success='accounts/
register_success.html'):
if request.method == 'POST':
form = RegisterForm(request.POST)
if form.is_valid():
formdata = form.cleaned_data
user = User.objects.create_user( formdata,

formdata,

formdata, )
UserProfile(user=user).save()

user = authenticate( username = formdata,
password = formdata )
login(request, user)
return render_to_response( template_name_success,
{ },
context_instance =
RequestContext(request) )
else:
form = RegisterForm()
return render_to_response( template_name,
{ 'form': form },
context_instance =
RequestContext(request) )

thanx!

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 24, 2010 01:49:11

Russell K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

authenticate problem with multiple db ?


On Thu, Jun 24, 2010 at 1:25 AM, Keats <neoke...@gmail.com> wrote:
> Hi,
> when authenticate is called i get this errorhttp://dpaste.com/210674/> though the user exist in database... is authenticate known to not work
> with multiple database context ?

I'm not aware of any problems. The authenticate code doesn't do
anything special with the database either, so I can't think of any
obvious sources of problems that might have been missed.

My first port of call would be to look into the way you have
multi-database configured, to ensure that the queries that are issued
can be directed to the appropriate database. If you're getting errors
that indicate that a user doesn't exist, that would suggest that the
query may be being routed to the wrong database.

Yours,
Russ Magee %-)

--
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 athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » authenticate problem with multiple db ? [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support