DataBase Navigator for Flask
Project description
DB Navigator
DataBase Navigator for Flask
More images
Installation
pip install DBNavigator
Usage:
from flask import Flask
from db_navigator import DBNavigator
app = Flask(__name__)
DBNavigator(app, "users.db", prefix="/admin", password="1234")
### Your Flask app
app.run(debug=True)
DBNavigator(app
, file
, prefix=""
, password=""
, login_func=None
, readonly=False
, db_engine
)
app |
Flask app |
file |
Target database local file |
prefix |
Route prefix |
password |
Access password |
login_func |
Custom login function |
readonly |
Default editable |
db_engine |
Default is SQLite |
Custom login
Must be returned True
for access.
It is recommended to save the password from the database in memory because it will be checked before each request.
def custom_login(password):
# make request to db
if password == "custom_value":
return True
DBNavigator(app, "users.db", login_func=custom_login)
DB Engine
A class that should inherit from the abstract class DataBaseInterface
and implement all its functions.
from db_navigator.databases import DataBaseInterface
class YourDBEngine(DataBaseInterface):
def __init__(self, *args):
super().__init__(*args)
self.__name__ = "Your DB Engine name"
💲Donate
Donatello | |
Donation Alerts |
(But now it's better to email me and I'll send you the details)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
DBNavigator-0.2.1.tar.gz
(251.4 kB
view hashes)
Built Distribution
DBNavigator-0.2.1-py3-none-any.whl
(254.0 kB
view hashes)
Close
Hashes for DBNavigator-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0bdaaa67c667e63d380938a763195b820165c25e63c6bc9b8fcb6f816ff270 |
|
MD5 | 4c7e6545c16148bb23ee08eb4238e91f |
|
BLAKE2b-256 | 15d159b9fdfc641c2d2bacb42cb4474c265f7cb8161ae3b836871fda556aa70a |