This is probably a very rare error that one may encounter in Django. But I think I should share it here, as it would save about an hour of anybody else who has this problem.
Problem
Exception Type: ImproperlyConfigured at /
Error importing authentication backend
Probable Cause
I was very desparate to change the name of an app inside my Django project. I renamed the folder name and all possible mentions of the application name anywhere in the code and the database tables (Please note: This is not recommended, there is probably a better solution to do this). Once I faced that problem with no clear indication of where I was going wrong, I looked everywhere in the code and the database. After going into panic mode, I tried desperately changing and removing anything that may break. In the end, I ran out of places to find the application name but the error still existed.
Solution
I had noticed after looking at my cookies that I still had cookies from my session, which meant that everytime I connected to the server, I was trying to pass my “delicious” cookies. But just deleting your own cookies won’t do it. The session object of the user was cached in the database inside the table “django_session”. This especially stores the “AUTHENTICATION_BACKENDS” last used. So, truncate the table: TRUNCATE TABLE django_session
to finally get rid of this nasty problem.
I love you! you saved my day.
Wow, I spent half a day looking into this. Thanks so much!
Thanks so much. It was driving me NUTS!
I was definitely barking up the wrong tree before finding your explanation. Thanks for making me sane again!
Lifesaver! Thank you.
You’ve just saved us thousands of (more) error mails 😀 Thanks for sharing that information with us!
Thanks a lot! wired issue
Thanks! That was driving me nuts!
Thank you for posting this, saved me so much time. This is a really nasty thing to track down.
Thanks! Now to fix the next set of errors 😛
thanks! you saved my brain …