[Fixed]-Can't login to Django /admin interface


Not too sure on this, but syncdb might remove the superuser you just created. Try creating a superuser when syncdb prompts you to.

Otherwise, take a look at the user model in ./manage.py shell. Check User.objects.all()[0].is_superuser.



There is some kind of limitation in django-nonrel.

To create a superuser:

  • Stop the local webserver
  • 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.


In urls.py uncomment:

# Uncomment the next line to enable the admin:
**# url(r'^admin/', include(admin.site.urls)),**

and that should make you good for the races 🙂

PS. do not forget to run a ./manage.py syncdb and it will ask to setup an admin user.



If you’re an idiot, like me, you might be trying to login with your email rather than your username.

I think I was doing this because when creating the superuser I remembered entering an email and not a username (because django offers you a username without having to type it), and perhaps the usual convention of using emails for usernames.. Man I feel stupid haha.



I had met the same situation just as you. And I found I switched the authentication backend to


And in the settings.py I had added a line:

AUTHENTICATION_BACKENDS = (‘someproject.backends.EmailCheckModelBackend’,)

And the backend is like:

class EmailCheckModelBackend(ModelBackend):
def authenticate(self, username = None, password = None, is_staff = None):
        user = User.objects.get(email = username)
        if user.check_password(password):
            if is_staff is not None:
                if user.is_staff == is_staff:
                    return user
                    return None
            return user

    except User.DoesNotExist:
        return None

You will find actually the username is forced to be alternated by ’email’. So you have to login your page with email account.
If like

Username: someone@somewhere.com

password: password

Then it works.
Hope this helpful for everyone.


I had the same problem and could not understand why I could not login because all the settings were correct. However, I traced it to Django offering me a superuser name containing an initial capital letter, but actually saving the name as completely lowercase!

I naturally used the superuser name with capitals (as offered by Django) and authentication failed. When inspecting the data tables to check ‘is_staff’ etc I spotted the error. I know I was not mistaken because I repeated the setup process a couple of times and noted the superuser credentials to be sure of details like case.

So, the moral is be careful when accepting the default name offered by Django! It lies!


In my case it was because I setup a Redis server


It’s not that difficult to fix.
First of all make sure to allow your default settings


in the settings file of your website folder.

Get into your website folder (using the command prompt), and type the following command:

$ python manage.py createsuperuser
email:e.g fulluser@admin.com

Go back into the browser and run the server. Set the username (not the email), alongside your password which you created earlier. It will surely work fine this time.

Leave a comment