Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add instructions/target for running dev dashboard #141

Merged
merged 1 commit into from
Nov 15, 2023
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ update-nodejs: ## reinstall the node.js files
@cd seamm_dashboard/static && python only_needed_files.py

run-demo: ## run a demo dashboard
@echo "Running as user:" `whoami`
@echo "Running in directory:" `pwd`
@echo "Directory Contents:" `ls -lthr data/`
seamm_dashboard/./results_dashboard.py --initialize --datastore $(shell pwd)/data --jwt-secret-key 'super-secret' --secret-key 'another-super-secret'
seamm_dashboard/./results_dashboard.py --initialize --datastore $(shell pwd)/data --jwt-secret-key 'super-secret' --secret-key 'another-super-secret'

run-dev: ## run a demo in dev/debug mode dashboard
seamm_dashboard/./results_dashboard.py --initialize --datastore $(shell pwd)/data --jwt-secret-key 'super-secret' --secret-key 'another-super-secret' --debug True

tags:
rm -f TAGS
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ If you do not have SEAMM installed, you can view a demo dashboard by using the d
make run-demo
```

If you are running the dashboard in production, you should use better secrets.
Open a browser and navigate to `http://localhost:5505/` to view the sample dashboard. Running the sample dashboard will create a user in the database with the same username you use on your computer the default password is `default`.

Open a browser and navigate to `http://localhost:5000/` to view the sample dashboard. Running the sample dashboard will create a user in the database with the same username you use on your computer the default password is `default`.
If you would like to run the same demo dashboard in development/debug mode, use the command

```bash
make run-dev
```

This will run the demo dashboard in debug mode, which will allow you to make changes to the code and see the changes reflected in the dashboard. Note that the dashboard will restart when you make changes to the code.
The development dashboard will be available at `http://localhost:5000/`.

### Running with SEAMM installed

Expand Down
8 changes: 5 additions & 3 deletions seamm_dashboard/results_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

def run():
app = create_app()
# app.run(debug=True, use_reloader=True)

# serve using waitress
serve(app, port=options["port"])
if options["debug"]:
app.run(debug=True, use_reloader=True)
else:
# serve using waitress
serve(app, port=options["port"])


if __name__ == "__main__":
Expand Down
Loading