First of all, I am a newbie. I'm running Ubuntu 11.04 which comes with Python 2.7 so I installed Python2.5 in different dir to run Django-Non-Rel on Google App Engine. I did the Guestbook tutorial and now I am trying to add admin access but when I type in correct username:password Django thinks its incorrect. It doesn't even work when deployed to GAE. If you know please poke me in the right direction.
I added:
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
INSTALLED_APPS = (
...
'django.contrib.admin',
....
)
EDIT
I also added
url(r'^admin/', include(admin.site.urls)),
to urls.py in subproject directory.
EOEDIT
Then I created superuser and synced databases:
> python2.5 xxx-xxx-guestbook/manage.py createsuperuser python2.5
> xxx-xxx-guestbook/manage.py syncdb
Then ran the app and can't login. I created multiple different supersusers always with the same result.
EDIT2
Thanks everyone for trying to help but unfortunately neither of the offered solutions fixed the problem. I have decided to first learn Django on its own and then maybe switch to GAE Django-nonrel, so the question is not relevant anymore. Should I still pick one answer to give someone some points?
'django-admin' is not recognized as an internal or external command, operable program or batch file. To fix this, first close the terminal window and relaunch it with administrator privileges. Once you launch the elevated terminal window change directory to where you wish to start your Django project.
Run 'python manage.py migrate' to apply them. Username (leave blank to use 'chatru'): admin Email address: [email protected] Password: Password (again): The password is too similar to the username.
Run django-admin help to display usage information and a list of the commands provided by each application. Run django-admin help --commands to display a list of all available commands. Run django-admin help <command> to display a description of the given command and a list of its available options.
There is some kind of limitation in django-nonrel.
To create a superuser:
Create the superuser
python manage.py createsuperuser
Run the webserver again
python manage.py runserver
Assuming you have the correct username and password, the only thing that will present the same behavior as a failed login is having is_staff=False
for the user in question.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With