views:

337

answers:

1

I'm using the Django nonrel project on a google app engine project running locally in development. I've created my own models and these are fine when they are saved and retrieved in the datastore.

I'm hoping to use django.contrib.auth to provide the user functionality. I can use the shell to create users and these get assigned an ID. When I create one of my own models which references User I have to pass in a user ID as it quite rightly fails otherwise.

However, checking via the gae admin interface I can't see the User model in the datastore for the users I've created via the shell. Nor can I retreive the user details from one of my models which references them. Calls to mymodel.user.username return nothing. Nor can I log into admin using the username and password I've set up. I can see saved versions of the models I've made in the gae admin app.

I get the impression that users are being created somewhere other than the datastore. Is there something else I need to do to use the standard contrib.auth users with django-nonrel and gae?

+2  A: 

I found the solution and thought I'd post back here just in case anyone comes across this question in future.

I was using the Google App Engine launcher. Django-nonrel makes changes to standard Django. The launcher uses standard Django which doesn't contain these changes. The solution is to use the manage.py runserver which will see all the Django non-rel changes including your own models and the Django contrib ones.

tooba