|
1 | 1 | # Plotly Dash Flask Tutorial |
2 | 2 |
|
3 | | - |
4 | 3 |  |
5 | 4 |  |
6 | 5 |  |
|
16 | 15 |
|
17 | 16 | Make Plotly Dash part of your Flask Application by following this example. |
18 | 17 |
|
19 | | -* The full tutorial can be found here: https://hackersandslackers.com/plotly-dash-with-flask/ |
20 | | -* A live demo can be found here: https://plotlydashflask.hackersandslackers.app/ |
21 | | - |
22 | | -## Installation |
23 | | - |
24 | | -**Installation via `requirements.txt`**: |
25 | | - |
26 | | -```shell |
27 | | -$ git clone https://github.com/toddbirchard/plotlydash-flask-tutorial.git |
28 | | -$ cd plotlydash-flask-tutorial |
29 | | -$ python3 -m venv myenv |
30 | | -$ source myenv/bin/activate |
31 | | -$ pip3 install -r requirements.txt |
32 | | -$ flask run |
33 | | -``` |
| 18 | +* **Tutorial**: https://hackersandslackers.com/plotly-dash-with-flask/ |
| 19 | +* **Demo**: https://plotlydashflask.hackersandslackers.app/ |
34 | 20 |
|
35 | | -**Installation via [Pipenv](https://pipenv-fork.readthedocs.io/en/latest/)**: |
| 21 | +# Getting Started |
36 | 22 |
|
37 | | -```shell |
38 | | -$ git clone https://github.com/toddbirchard/plotlydash-flask-tutorial.git |
39 | | -$ cd plotlydash-flask-tutorial |
40 | | -$ pipenv shell |
41 | | -$ pipenv update |
42 | | -$ flask run |
43 | | -``` |
| 23 | +Get set up locally in two steps: |
44 | 24 |
|
45 | | -**Installation via [Poetry](https://python-poetry.org/)**: |
46 | | - |
47 | | -```shell |
48 | | -$ git clone https://github.com/hackersandslackers/plotlydash-flask-tutorial.git |
49 | | -$ cd plotlydash-flask-tutorial |
50 | | -$ poetry shell |
51 | | -$ poetry update |
52 | | -$ poetry run |
53 | | -``` |
54 | | - |
55 | | -## Usage |
| 25 | +### Environment Variables |
56 | 26 |
|
57 | 27 | Replace the values in **.env.example** with your values and rename this file to **.env**: |
58 | 28 |
|
59 | | -* `FLASK_APP`: Entry point of your application (should be `wsgi.py`). |
60 | | -* `FLASK_ENV`: The environment to run your app in (either `development` or `production`). |
| 29 | +* `FLASK_APP`: Entry point of your application; should be `wsgi.py`. |
| 30 | +* `FLASK_ENV`: The environment in which to run your application; either `development` or `production`. |
61 | 31 | * `SECRET_KEY`: Randomly generated string of characters used to encrypt your app's data. |
62 | | -* `LESS_BIN`: Path to your local LESS installation via `which lessc` (optional for static assets). |
63 | | -* `ASSETS_DEBUG`: Debug asset creation and bundling in `development` (optional). |
64 | | -* `LESS_RUN_IN_DEBUG`: Debug LESS while in `development` (optional). |
65 | | -* `COMPRESSOR_DEBUG`: Debug asset compression while in `development` (optional). |
| 32 | +* `LESS_BIN` *(optional for static assets)*: Path to your local LESS installation via `which lessc`. |
| 33 | +* `ASSETS_DEBUG` *(optional)*: Debug asset creation and bundling in `development`. |
| 34 | +* `LESS_RUN_IN_DEBUG` *(optional)*: Debug LESS while in `development`. |
| 35 | +* `COMPRESSOR_DEBUG` *(optional)*: Debug asset compression while in `development`. |
66 | 36 |
|
67 | 37 |
|
68 | 38 | *Remember never to commit secrets saved in .env files to Github.* |
69 | 39 |
|
| 40 | +### Installation |
| 41 | + |
| 42 | +Get up and running with `make deploy`: |
| 43 | + |
| 44 | +```shell |
| 45 | +$ git clone https://github.com/hackersandslackers/plotlydash-flask-tutorial.git |
| 46 | +$ cd plotlydash-flask-tutorial |
| 47 | +$ make deploy |
| 48 | +``` |
| 49 | + |
70 | 50 | ----- |
71 | 51 |
|
72 | 52 | **Hackers and Slackers** tutorials are free of charge. If you found this tutorial helpful, a [small donation](https://www.buymeacoffee.com/hackersslackers) would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content. |
0 commit comments