def get(self, post_no): try: post = MessageManager.getMessage(long(post_no)) context = {'msg_post': post} tpl = os.path.join(os.path.dirname(__file__), 'templates/view_message.html') self.response.out.write(render(tpl, context)) except (TypeError, ValueError): self.error(500)