[Fixed]-Can't login to django admin after creating a super user with a custom user model


The code is fine. The problem is you’re using the RemoteUserBackend exclusively, instead of the default backend:


I’ve never used it myself, but from the docs it’s clear that it’ll only check for a REMOTE_USER header in your requests, thus making your password login attempts irrelevant.

You could add the default ModelBackend as a fallback, if you wan’t to have both available:


or get rid of the RemoteUserBackend alltogether and have your app authenticate the default way.

Hope this helps.


Maybe you could also try to set in the create_superuser

user.is_active = True


Make sure you Super User is associated to one of the profiles you have created, maybe by iserting it manually intro you DB.

Take care

Leave a comment