I want to insert from a Django into another Django database from other domain a proper password text in auth_user table.
I have tried to generate a encrypt function but I don't know how Django generates a password from plain text into hashed password that is stored in database.
postgres_insert_query = """
          INSERT INTO auth_user (username, first_name, last_name, email, password) VALUES (%s,%s,%s,%s,%s)
        """
        record_to_insert = (username, first_name, last_name, email, password)
        cursor.execute(postgres_insert_query, record_to_insert)
        connection.commit()
        cursor.close()

django-createuser.PASSWORD_HASHERSsetting: docs.djangoproject.com/en/2.2/topics/auth/passwords/… and therefore even if you manage to get it working, later it might fail, because the settings have changed.