loki
loki

Reputation: 2311

GAE and django same users

I'm running a GAE and Django helper project and i ran into some issues when creating a User from de django shell. After exploring the code under the helper directory i came across with the following code:

class User(BaseModel):  
      user = db.UserProperty(required=True) 

My question is, do i have to bind the django user to a google account if so, how do i create a django or google user from my code?

UPDATE: I meant to say create the account without having the google account itself. For instace not having:

users.get_current_user()

UPDATE: A user must be able to create a new account just like regular django users, with a register page for that matter.

Upvotes: 0

Views: 87

Answers (1)

Senthil Kumaran
Senthil Kumaran

Reputation: 56951

For AppEngine, you can get the users who are logged into your application.

from google.appengine.api import users

And then you do

username = users.get_current_user()

And set your user property

User(user=username)

You could lookup the tutorial on how to do redirect to login to ask the application to login to get the user.

Upvotes: 1

Related Questions