Dash Authorization Package.
Project description
Dash Authorization and Login
Docs: https://dash.plotly.com/authentication
License: MIT
For local testing, create a virtualenv, install the dev requirements, and run individual tests or test classes:
python -m venv venv
. venv/bin/activate
pip install -r dev-requirements.txt
python -k ba001
Note that Python 3.8 or greater is required.
Usage
Basic Authentication
To add basic authentication, add the following to your Dash app:
from dash import Dash
from dash_auth import BasicAuth
app = Dash(__name__)
USER_PWD = {
"username": "password",
"user2": "useSomethingMoreSecurePlease",
}
BasicAuth(app, USER_PWD)
One can also use an authorization python function instead of a dictionary/list of usernames and passwords:
from dash import Dash
from dash_auth import BasicAuth
def authorization_function(username, password):
if (username == "hello") and (password == "world"):
return True
else:
return False
app = Dash(__name__)
BasicAuth(app, auth_func = authorization_function)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dash_auth-2.1.0.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for dash_auth-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5b85c55e6a3f4e58485daf648366af52f8366f7ec62c1c88f68521a08662f5c |
|
MD5 | 83c53211128d2099028ac26b1b5c1bea |
|
BLAKE2b-256 | f84b0f1c36c7c27fc283200b23223dbfb1441636e628cff027e599a21fbe565a |