I am using a Django-based web application in Python 3.
The logout method will redirect me to a different view and it will also call sys.exit("str")
def logout(request):
try:
logger.info("Logging Out")
del request.session['role']
del request.session['email']
del request.session['fullname']
del request.session["token"]
session.close()
sys.exit("bye")
return redirect("/login")
except Exception as e:
logger.info("Exception : {}".format(e))
The above code was redirecting me as expected. Recently I introduced iframes in the template html, so that the pages are rendered in iframe when clicked from a side menu navigation.
<div class="sidenav">
<a href="lkpview" target="iframe1">About</a>
<a href="logout" >Sign out</a>
</div>
<div class="main">
<iframe width="90%" height="300" name="iframe1">
</iframe>
</div>
Now if click on "Sign out" I am getting this error:
A server error occurred. Please contact the administrator.
Not sure of this, and it did not occur before I introduced the iframe to the Django template. What can I try next?