'Redirect to another view django
I want to redirect to anothe view if validate_token method return false but when i do like the code below it does not redierct me to the other app context it just return a html page without django templating
def home_view(request, *args, **kwargs):
if 'token' in request.session:
if model.validate_token():
return render(request, "home.html", {})
else:
return render(request, "login.html", {})
else:
return render(request, "login.html", {})
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
