This code renders out a template ‘sites.htm’ in response to the POST request:
def post(self):
acct = self.request.get('account')
pw = self.request.get('password')
que = db.Query(User)
que = que.filter('account =', acct)
que = que.filter('password =', pw)
results = que.fetch(limit = 1)
values = { }
newval = dict(values)
newval['path'] = self.request.path
if len(results) > 0:
arraySample = ['6','7','8','ninja']
path = os.path.join(os.path.dirname(__file__), 'templates/sites.htm')
self.response.out.write(template.render(path, {'arraySample':arraySample,'message':'Ninja IDE'}))
But I want my application to respond to that login attempt by redirecting to ‘sites.htm’ with the parameters of a dictionary.
I can’t just do self.redirect('sites.htm') because the elements from the dictionary won’t be shown.
Is there a way I can pass the dictionary as a url parameter to redirect() method?
Thanks in advance and I hope I was clear enough!
put the dictionary in the query string. HTTP 101