Skip to content

Commit 8345d4f

Browse files
committed
combine file rename tips and show reload and port directly in first terminal run example
1 parent 18a4fd7 commit 8345d4f

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

tutorials/intro-express/1-welcome.qmd

+10-12
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ as you make changes to the `app.py` file.
103103
![](img/010-run_app.png)
104104
:::
105105
106+
:::
107+
106108
::: {.callout-tip}
107109
## Naming your files
108110
109111
If you start your file with the word `app`,
110112
the shiny for python extension will recognize
111113
it as an application and you will be able to see the "play" button to run your application.
112-
You can also name your file `app-getting_started.py`
114+
You can also name your file `app-get_started.py`
113115
and you will still get the shiny extension play button.
114116
115117
To have Shiny for Python work well with the VS Code extensions and for you to go through
@@ -118,8 +120,12 @@ We recommend either one of the following file naming conventions:
118120
119121
1. Create separate folders for each app example you will create and save separate `app.py` files in each folder
120122
2. Create separate `app*.py` files in the same directory (e.g., `app-01.py`, `app-02.py`)
121-
:::
122123
124+
If you named your application `app.py` you can omit it form the command and only use `shiny run --reload`.
125+
The `app.py` is the default file Shiny looks for to run in the current directory.
126+
Otherwise, you can pass in the name of the file that you wish to run.
127+
The `app` prefix used in the example above is used to signal to the Shiny VS Code extension
128+
to display the run app button.
123129
:::
124130
125131
## Run your shiny application
@@ -130,27 +136,19 @@ This is useful if you wish to specify your own port or want to rename your appli
130136
without the `app` prefix.
131137
132138
```bash
133-
shiny run my_app.py
139+
shiny run my_app.py --reload --port 8000
134140
```
135141
136-
::: {.callout-note}
137-
If you named your application `app.py` you can omit it form the command and only use `shiny run`.
138-
The `app.py` is the default file Shiny looks for to run in the current directory.
139-
Otherwise, you can pass in the name of the file that you wish to run.
140-
The `app` prefix used in the example above is used to signal to the Shiny VS Code extension
141-
to display the run app button.
142-
:::
143-
144142
:::{.callout-tip}
145143
## Helpful run options
146144
147145
Some useful options you can pass the `shiny run` command are:
148146
147+
- `--reload`: Enables auto-reload, the application will reload to reflect your changes as you save your work.
149148
- `--port`: pass in a custom port, e.g., `--port 8000`.
150149
This will run the app on the specified port,
151150
instead of a random port.
152151
This makes it easier to have the same browser window open as you stop and start your application.
153-
- `--reload`: Enables auto-reload
154152
155153
You can learn more about these run options on the
156154
[`run_app` documentation page](https://shiny.posit.co/py/api/core/run_app.html).

0 commit comments

Comments
 (0)