M
M
MonsterAndrew2018-02-06 16:09:39
Python
MonsterAndrew, 2018-02-06 16:09:39

Is it necessary to do finish() in Tornado after render() or redirect()?

There is the following code:

@gen.coroutine
    def get(self):
        if ...:
            if self.request.headers.get("Accept-Language").startswith("ru"):
                self.render(...)
            else:
                self.render(...)
        else:
            self.write(...)

Should I write self.finish()after self.render() или self.redirect()? I heard that if there is a render or redirect, then it is not necessary, but if there is a gen.coroutine, then you must always write finish.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question