Flask (Python)

Table of contents

Child pages

Related pages


http://flask-appbuilder.readthedocs.org/en/latest/index.html

http://flask.pocoo.org/






How to take a bare-bones Flask app and gradually add onto it

It seems like the official Flask tutorial does a pretty good job of succinctly covering this topic: http://flask.pocoo.org/docs/0.12/tutorial/

  1. Have it use templates.
    1. Create a 'templates' folder in the same directory that contains the main app file.
    2. Create files in the folder that are named after the pages they correspond to, and have an .html extension.
    3. In your view functions, update the code to return "render_template('index.html')", where 'index.html' is replaced with the name of the template that should be rendered for that view function.

AWS

Accepting payments

Deploying

Flask-SQLAlchemy

Misc

  • Show all running processes on the DB: open a console (right-click the db in PyCharm and select 'Open Console') and then paste in SHOW PROCESSLIST; and hit 'Play'.

"QueuePool limit reached" error

I fixed the error by getting rid of "threaded=True" from my "app.run()" call. I posted info about it here.

Similar errors
The exact same error
How can I check the status of the QueuePool?

Sessions

  • Summary: My impression at the moment is that sessions are basically cookies where the cookie is guaranteed against tampering.
  • 2016.04.04 - Miguel Grinberg - How Secure Is The Flask User Session?
    • Flask session cookies are designed to not be tampered with, but they are not designed to be hard to read.
    • You can read the contents of a Flask session cookie by running base64.urlsafe_b64decode(<session_string_before_the_period>)
    • So don't put anything that should be kept secret in those cookies.

Static site generators

Tutorials

Tools