Table Of Contents

Next topic

Flask-Login Integration

This Page

Welcome to Flask Kit’s documentation!

Flask Kit is extendable backbone for your new Flask projects and the set of useful helpers to avoid some routine.

It makes use of some useful extensions from official Flask extensions registry.

Have a look in ext and app to see how they are used.

Below a brief description for each of them.

Used extensions

DebugToolbar : in-browser debug tools

Flask-DebugToolbar is a port of the Django debug toolbar to Flask.

Login: user authentification layer

Flask-Login provides user session management for Flask. It handles the common tasks of logging in, logging out, and remembering your users’ sessions over extended periods of time.

It will:

  • Store the active user’s ID in the session, and let you log them in and out easily.
  • Let you restrict views to logged-in (or logged-out) users.
  • Handle the normally-tricky “remember me” functionality.
  • Help protect your users’ sessions from being stolen by cookie thieves.
  • Possibly integrate with Flask-Principal or other authorization extensions later on.

SQLAlchemy : the ORM layer

Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application. It aims to simplify using SQLAlchemy with Flask by providing useful defaults and extra helpers that make it easier to accomplish common tasks.

WTF : Better forms

Flask-WTF offers simple integration with WTForms

With WTForms, your form field HTML can be generated for you, but you can customize it in your templates. This allows you to maintain separation of code and presentation, and keep those messy parameters out of your python code.

Testing : Unit testing for agile development

Flask-Testing provides unit testing utilities for Flask.

Script - Command-line tools

Flask-Script provides support for writing external scripts in Flask. This includes running a development server, a customised Python shell, scripts to set up your database, cronjobs, and other command-line tasks that belong outside the web application itself.

Flask-Script works in a similar way to Flask itself. You define and add commands that can be called from the command line to a Manager instance:

Assets - static files optimization

Flask-Assets integrates the webassets library with Flask, adding support for merging, minifying and compiling CSS and Javascript files.

Asset management application for Python web development - use it to merge and compress your JavaScript and CSS files.

Gravatar - User avatar on the cloud

Flask-Gravatar is a small extension for Flask to make using Gravatar (“Globally Recognized Avatar”) easy.

Well, maybe not essential.

Check the reqs.pip for the actual version numbers .

Flask Kit modules

Todo

In Flask-kit, the base.models.User inherits from flask.ext.login.UserMixin so the needed methods are not implemented properly.

Write a few tests first and then implement as needed.

(The original entry is located in /home/mich/Learn/webauth/flask/flask-kit/doc/api/integrate-login.rst, line 116.)

Todo

Add assets managements, as described in flask.ext.assets.management-command

(The original entry is located in /home/mich/Learn/webauth/flask/flask-kit/manage.py:docstring of manage, line 23.)

Indices and tables