I want to have AUTH header for all django requests and responses.
I have a question (python 3.7 - django 2.1):
I want to authenticate the users via JWT tokens.
I don't want to use Models.py or external libraries like as Rest-Framework.
I built a mysql-db for managing CRUD operation for working with JWT-tokens and user-management.
My Problem:
I want to add a "AUTH" header in HTTP request (if username and password were correct) to incoming request from "http://127.0.0.1:8080/my_dj_app/register" page; and then i want to redirect user to Login page ("http://127.0.0.1:8080/my_dj_app/dashboard").
So (when user is redirecting to Dashboard, I'm checking the value of AUTH header in DB in incoming-request), in Dashboard view, again, I'm checking the AUTH header for authorization/authentication the user.
Note: via this topic, i can add AUTH in reponse header. but how i can redirect user to dashboard !? Django: Add response header when using render or render_to_response
above scenario is possible !?. how i can do it !?. please help meeeee.
response = render(request, "my_dj_app/dashboard.html", {})
response['AUTH'] = JWT_TOkEN
return response
but above code, can't to solve my problem :(