Python/flask: Difference between revisions
Appearance
< Python
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 18: | Line 18: | ||
</pre> | </pre> | ||
</blockquote> | </blockquote> | ||
== Disable flask log == | |||
<pre> | |||
import logging | |||
log = logging.getLogger('werkzeug') | |||
log.setLevel(logging.ERROR) | |||
</pre> | |||
== Links == | |||
* https://github.com/tko22/flask-boilerplate | |||
* https://code.visualstudio.com/docs/python/tutorial-flask | |||
Latest revision as of 12:14, 19 June 2020
redirect
@app.route('/')
def hello():
return redirect("http://www.example.com", code=302)
@app.route('/')
def root():
def get():
yield "Getting data..."
dostuff()
yield '<script>document.location.href="http://192.168.111.11:5000/list"</script>'
Disable flask log
import logging
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)