https://github.com/bluecolor/dash-skeleton
An extended version of dash community edition
https://github.com/bluecolor/dash-skeleton
data-science ldap plotly plotly-dash postgre python
Last synced: 9 months ago
JSON representation
An extended version of dash community edition
- Host: GitHub
- URL: https://github.com/bluecolor/dash-skeleton
- Owner: bluecolor
- Created: 2020-10-04T11:30:15.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2020-12-10T17:58:18.000Z (over 5 years ago)
- Last Synced: 2025-04-03T14:16:10.376Z (over 1 year ago)
- Topics: data-science, ldap, plotly, plotly-dash, postgre, python
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Plotly Dash Skeleton App
- [x] create user with cli
- [x] login
- [x] logout
- [x] home
- [x] change password
- [x] edit profile
- [x] logging
- [x] gunicorn `gunicorn -w 4 "app:create_app()"`
- [x] https `gunicorn --certfile=server.crt --keyfile=server.key --bind 0.0.0.0:443 "app:create_app()"`
- [x] caching
- [x] loading indicator
- [x] ldap integration
### Usage
- Create virtual environment
```
virtualenv -p python3 venv
```
- Activate
```
. venv/bin/activate
```
- Install dependencies
```
pip install -r requirements.txt
```
- Setup database (tested with postgre and sqlite)
if you use sqlite
```
export APP_DATABASE_URL=sqlite:///dash.db
```
if you use postgre
```
export APP_DATABASE_URL=postgresql://dash:dash@localhost:5432/dash
```
- Drop tables
```sh
python manage.py database drop-tables
```
- Create tables
```sh
python manage.py database create-tables
```
- Create user
```
python manage.py user create
```
- Run
```
chmod +x debug.sh
./debug.sh
```
### Adding new sub-apps
Put new folders under `app/pages/ext`.
Each added folder represents a sub application
Each added folder must contain app.py file
It will automacilly appear in "Applications" in navigation bar.
Basic example:
```py
import dash_html_components as html
from app.pages import registery
# registery item props
#
# render: Render method
# name: Report name
# id: Report id, optional
# groups: [Report group]
# descripttion: Report description
def render():
return html.Div([ html.H3('Hello') ])
item = {
"render": render,
"name": "Hello report",
"id": "20",
"groups": ["analytics", "ai"],
"description": """My another awesome report"""
}
registery.register(item)
```
### Additional settings
```sh
export DASH_TITLE= # Browser Title
export DASH_BRAND= # Nav Brand
```
Enjoy.