4
votes

I got the django-nonrel setup fine, and worked through the first 5 chapters of the djangobook without any real problems. I'm currently on chapter 6 which talks about creating the admin site. http://www.djangobook.com/en/2.0/chapter06/ But, I can't login.

I can get to the admin login page on localhost, but it always says my username and password are incorrect.

Some suggest to "Go into your database and inspect the auth_user table. Make sure that is_staff is set to TRUE on the user you are using to log in." I went into here: "python manage.py shell" And saw that my superuser was there, and that is_staff was true.

I created a superuser with the server running and without it running, and neither one allowed me to login afterwords.

One user (crogjer) suggested the following:

This might be the problem:

You have setup a database for a normal django project. So manage.py createsuperuser will create a superuser in that database.

In case of GAE SKD, it uses the GAE Datastore, so the superuser you created is not present >there.

This is what you could do:

Create a normal user Go to /_ah/admin/ and modify the data for user table in datastore, changing the desired >users is_superuser field to True.

What is the SKD? Does that sound like the answer to my problems? If so, how do I create a normal user?

Here are some of the reference posts I saw: I've looked around at the following posts: Can't login to Django /admin interface django-nonrel google app engine fail to log in admin panel Django-nonrel can't login as super user

Any ideas what I might be doing wrong? Thanks!

1
Not really a solution, but running this from a view will allow me to create an admin user: User.objects.create_superuser(username, email, admin) . Thr problem seems to be that the management console and the local dev server don't use the same datastore.endre

1 Answers

2
votes

I got it. I was running the server through the GoogleAppEngineLauncher when it wasn't working, and I just needed to stop the local server, create the super user, and then run it through

 python manage.py runserver