Django does not store passwords as plain text. He hashes them first, and they store the hash. Therefore, when a user logs in, Django applies the same hash function to user input, and then compares two hashes - from the user's login and what is stored in db.
However, to make things more flexible, Django does not store password hashes, but in addition it also stores the algorithm by which the hash is generated. Imagine this scenario - you use the hash function X to generate password hashes, but then you realize that this function is no longer protected for any reason, and you switch to the hash function Y This, however, is a problem because at the moment the hash password is stored using the X function, they will no longer be able to log in. That is why Django also saves the method with which it was created, in addition to the hash value itself. The parameter PASSWORD_HASHERS indicated here. The fact that Django stores the method by which the hash is generated in db, when reading the value, it does not tell Django how to execute the hash function. So PASSWORD_HASHERS is a kind of mapping between a Python hash function (actually a class, but anyway ...) and a value stored in db.
So, back to your question. The error message means that Django is not aware of the password hash function that was used to store the password hash in your database, or at least not in PASSWORD_HASHERS .
I can come up with a couple of reasons why this could happen.
Make sure you run syncdb , it uses the same settings.py file as when starting the server to access the administrator. It may be that different settings are used.
However, developers usually do not change PASSWORD_HASHERS in settings.py and simply use the default value. In this case, make sure that you use the same Python with the same version of Django installed when you run syncdb and when the server starts. If you make syncdb in the same virtual directory, for example, and start the server in different env, then the versions of Django may be different, so they may have different settings for PASSWORD_HASHERS , and therefore, when running syncdb it can use a hash function that is not defined when server startup.
source share