The simplest way to add login to flask!
Add yourself, send a PR!
First install it from PyPI.
pip install flask_simplelogin
from flask import Flask
from flask_simplelogin import SimpleLogin
app = Flask(__name__)
SimpleLogin(app)
Now you have /login
and /logout
routes in your application.
The username defaults to admin
and the password defaults to secret
(yeah that's not clever, let's see how to change it)
To visualize changes on the documentation, it's necessary to install some packages and use Sphinx.
$ pip install -r docs/requirements.txt
$ sphinx-build docs docs/build
After that, access: docs/build/index.html
.