How to use django.contrib.auth with app-engine-django helper?

10 views
Skip to first unread message

n.derachits

unread,
Oct 18, 2009, 8:42:15 AM10/18/09
to app-engine-django
I tried the code from django documentation:

>>> from django.contrib.auth.models import User
>>> user = User.objects.create_user('john', 'len...@thebeatles.com', 'johnpassword')

and I got this error:
AttributeError: type object 'User' has no attribute 'create_user'

My questions are:
1. How to create a new user with given nickname and password?

2. Is it possible to authenticate google accounts only when app-engine-
django-helper is added to project?

Andy Smith

unread,
Oct 19, 2009, 6:52:47 PM10/19/09
to app-engi...@googlegroups.com
At the moment the contrib.auth code emulation provided by the helper requires you to use the app engine users code, so you would have a user log in (as described in the app engine Getting Started guide) and then something like

from appengine_django.auth.models import User
from google.appengine.api import user
new_user = User.get_djangouser_for_user(user.get_current_user())



 


ravi

unread,
Nov 8, 2009, 1:40:25 PM11/8/09
to app-engine-django
So how does one create new users? I am a new to django and GAE...

On Oct 19, 2:52 pm, Andy Smith <andys...@gmail.com> wrote:

Andy Smith

unread,
Nov 20, 2009, 5:51:19 PM11/20/09
to app-engi...@googlegroups.com
you'd be using the google user's api http://code.google.com/appengine/docs/python/gettingstarted/usingusers.html

if you're using that the contrib auth framework works pretty automatically

--

You received this message because you are subscribed to the Google Groups "app-engine-django" group.
To post to this group, send email to app-engi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/app-engine-django?hl=en.



Reply all
Reply to author
Forward
0 new messages