Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

## Definition of done

CI covers the first two. The rest are yours — tick them because you did them,
not because they were already ticked. See `CONTRIBUTING.md` for why each is here.
CI covers the first two. See `CONTRIBUTING.md` for why each is here.

- [ ] `pytest` passes
- [ ] `black` is clean
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ python-dashboard-template/
├── src/
│ ├── app.py # Main application file
│ ├── theme.py # Colours, type scale and the Plotly template
│ ├── memory_log.py # Dev aid: prints RSS memory usage, see LOG_MEMORY
│ ├── assets/ # Static files (CSS, images, sample data)
│ └── pages/ # One module per page, each with dash.register_page
│ ├── home.py
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pre-commit install --hook-type pre-push

cp .env.example .env # optional; defaults work as-is

python src/app.py # the app, on :8050
python src/app.py # the app, on :5050
pytest # the tests
black . # format
pre-commit run --all-files # run configured hooks manually
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Requirements are split by purpose: `requirements.txt` is what the dashboard
needs to run, `requirements-dev.txt` adds pytest, black and pre-commit, and
`requirements-notebooks.txt` adds Jupyter for `notebooks/`.

Then open <http://127.0.0.1:8050>. Debug mode is on, so saving a file reloads
Then open <http://127.0.0.1:5050>. Debug mode is on, so saving a file reloads
the app.

Optional but recommended: `pre-commit install --hook-type pre-commit` runs
Expand All @@ -32,22 +32,23 @@ they reach CI at all. See `CONTRIBUTING.md` for the full set of hooks.

## Configuration

There isn't much. Two variables come from `.env` (copy `.env.example` and
Five variables come from `.env` (copy `.env.example` and
edit it; `.env` is gitignored):

- `DASH_DEBUG` - the only setting with a security consequence: its debug console can run arbitrary Python for anyone who reaches it. Keep it `true`
on your own laptop for hot reloading; set it `false` on anything anyone else can reach.
- `DASH_DEBUG` - the only setting with a security consequence: its debug console can run arbitrary Python for anyone who reaches it. Keep it `true` on your own laptop for hot reloading; set it `false` on anything anyone else can reach.
- `PORT` - which port to listen to. Defaults to 4insight's port (5050).
- `MOCK_PLATFORM_HEADER` (and `MOCK_PLATFORM_SPACER`) - see "Fitting the
4insight frame" below.
- `LOG_MEMORY` - toggles the memory logger, which prints the app's RSS memory to terminal every time the user navigates between pages. Defaults to false.

`app.run(debug=DASH_DEBUG)` uses Dash's own defaults (`127.0.0.1:8050`).

## Layout

```
src/
├── app.py Dash shell: side navigation, mock 4insight header
├── theme.py colours, type scale and the Plotly template
├── memory_log.py dev aid: prints RSS memory usage, see LOG_MEMORY
├── pages/
│ ├── home.py example: an AgGrid over the sample data
│ └── analytics.py example: a slicer driving a filtered Plotly chart
Expand Down
Loading