I have started using django very recently . I am building a service with user login.
Login , I am sending as POST service. There is a template to render , once the user is logged in.
But the browser address is not getting updated.
eg : abc.com the root my form would be something like
“form action=”/login” …..>”
Once user press the login button browser URL wil be abc.com/login. After login I want the
url to be “abc.com” again .
Pls help me .
If you use the built-in Django authentication, you can redirect after login or logout by using the built-in functions. You can redirect to a specific page or you can redirect them to the page they were trying to access.
For example, the doc above uses the following example in using the login_required decorator:
I highly recommend checking out the above doc. When I first setup Django’s authentication, I was impressed that it only took me about 30 minutes to set it up the way I wanted it, and most of that time was reading the above page.