views:

34

answers:

2

Do anyone know how do use javascript to redirect user login using Google Accounts?

I know there is "users.create_login_url(self.request.path)" but how do that integrated to "`window.location"

Or there is alternative??

+1  A: 

You should be able to pass the string that is created by *users.create_login_url(self.request.path)* to your template as a template variable, and then the template variable can be inserted into your Javascript with double curly braces (if you are using the bundled Django templates):

window.location = {{ authention_url }}

where authentication_url is the template variable that you created in your RequestHandler.

Adam Crossland
A: 

My fault, I dont even know that users.create_login_url(self.request.path) will generate a string, simply print it out will do.