[Fixed]-Log in user python, how validate a log in user?

1👍

You need to set AUTH_USER_MODEL in your settings.py with your custom user model like:

AUTH_USER_MODEL = 'appname.MiUsuario'

Changing AUTH_USER_MODEL has a big effect on your database structure. It changes the tables that are available, and it will affect the construction of foreign keys and many-to-many relationships. If you intend to set AUTH_USER_MODEL, you should set it before creating any migrations or running manage.py migrate for the first time.

Changing this setting after you have tables created is not supported
by makemigrations and will result in you having to manually fix your
schema, port your data from the old user table, and possibly manually
reapply some migrations.

check this link for more details

Leave a comment