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 details)
Built Distribution
File details
Details for the file dash_auth-2.1.0.tar.gz
.
File metadata
- Download URL: dash_auth-2.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82b9bd6fb82bef28aab4f4bb09989697bfe8779cfb6e7c5523f98a6601646ed7 |
|
MD5 | 8a7f09c65c708fe13e3bc27ccedcb42d |
|
BLAKE2b-256 | 4b48166e935873d6bd75016669958040b0a2d99cea6304de595076051e5c4c16 |
Provenance
File details
Details for the file dash_auth-2.1.0-py3-none-any.whl
.
File metadata
- Download URL: dash_auth-2.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5b85c55e6a3f4e58485daf648366af52f8366f7ec62c1c88f68521a08662f5c |
|
MD5 | 83c53211128d2099028ac26b1b5c1bea |
|
BLAKE2b-256 | f84b0f1c36c7c27fc283200b23223dbfb1441636e628cff027e599a21fbe565a |