I was wondering if it is possible to redirect from within a render method in twisted web.
I have tried the various ways of redirecting and have only found it documented when used in the getChild method.
Basically I am checking to see if a user is logged in and if it isn't then forward the user onto a different Resource.
def render_GET(self, request):
player = getPlayer(request)
if player.loggedIn():
return Redirect("play")
else:
return Redirect("login")
I have looked all over but I am unable to find a well documented example on twisted documents.
I am not sure if I need to change my approach to this and I am new to twisted web. Any help would be greatly appreciated.
Thank you