user authentication

as i know till authentication system works on built in backend Right? , and model which we create in models.py file it uses built in backend.

Ok. The bottom line is you’re not creating users. You’re making entries in a table that has nothing to do with the authentication system. There isn’t anything obviously wrong with your authentication logic, it’s that you don’t have the users created to authenticate with.

You should read the complete set of docs at
https://docs.djangoproject.com/en/4.0/topics/auth/customizing/

i have render that form as registration form , through it i am registering user, and i am using same method from where i have learnt yet entire django, when he is able to do login, same thing did what he did, link you have mentioned it is about customizing authentication, i do not want to customize built in method.

The way you are trying to do this is wrong. This is not going to work. You don’t just create some arbitrary model and expect all the built-in facilities associated with authentication to work with it without doing the work to make those other modules work with it.

You need to read, completely and carefully, that page linked to in my prior response.

you mean to say i will have to create Custom user model right?, you might be a true , but what i am thinking, django where i have learnt, that person did same thing which i have shown in code., he able to do login these ways, why cant i?

I can’t explain what anyone else has done without seeing their code.

No, I’m not saying that you need to create a Custom user model. You could also create a “user profile” model to store any additional data you need to keep associated with that user.

it can be possible by mentioning pk=id right?, but that is not an real issue authenticated user should redircted url. whether we mention pk=id or not.

I’m sorry, I have no idea what you’re trying to address here by this statement.

What “can be possible”?

okay, no problem , thank you for the help.