Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django admin site not accepting superuser

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

like image 316
mrmagooey Avatar asked Mar 14 '11 06:03

mrmagooey


2 Answers

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.

like image 104
mrmagooey Avatar answered Nov 10 '22 01:11

mrmagooey


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.

like image 28
Gabriel Hurley Avatar answered Nov 09 '22 23:11

Gabriel Hurley