5
votes

My admin site has started refusing to let any superusers log in. I've tried making a whole new set of superusers using manage.py, but the admin site doesn't see any of them, even while manage.py is happy to change passwords for existing superusers.

Haven't made any changes to the admin packages, what I did do however was delete the SQLlite database to clear all the test stuff I've put in. I ran syncdb immediately after, but admin isn't having a bar of it, even after making multiple superusers as per above. So, pretty new to django and at a bit of a loss as to the next step.

Cheers

2
As far as i understand, you can not enter admin site with any existing user you created. Did you make any changes to settings.py? Can you reach your admin site from <your-site-url>/admin url? - FallenAngel
Worked out what the problem was, it's pretty well spelled out in this, but basically I had added the django-facebook auth backend, which then apparently meant that the normal auth backend was not included and this is what admin uses. To steal the answer from the above link, django.contrib.auth.backends.ModelBackend needs to be added to AUTHENTICATION_BACKENDS. - mrmagooey
Hah, I was about to ask! Thought it sounded like a familiar problem : ) PS: In this case, you should answer your own question and accept it. - Yuji 'Tomita' Tomita
Cheers @Yuji, both for the answer and the tip on answering. - mrmagooey

2 Answers

10
votes

Worked out what the problem was, it's pretty well spelled out in this, but basically I had added the django-facebook auth backend, which then apparently meant that the normal auth backend was not included and this is what admin uses. To steal the answer from the above link, django.contrib.auth.backends.ModelBackend needs to be added to AUTHENTICATION_BACKENDS.

Thanks to Yuji.

3
votes

Fairly basic, but do the users have is_staff and is_active set to True?

If that's not the problem then we'll probably need more information. You could post the output of manage.py dumpdata auth.User --indent 4 to let us see what your User data looks like, which might help.