I have a Python Shiny app that looks like this:
from shiny import App, ui, render
import os
app_ui = ui.page_fluid(
ui.output_text("my_text")
)
def server(input, output, session):
@output
@render.text
def my_text():
return os.environ['BOOP']
app = App(app_ui, server)
And I deploy it to ShinyApps.IO like this:
rsconnect deploy shiny . --name myname --title your-app-name -E BOOP=test
The environment variable does not get printed as expected. Now, say I specify it in my local environment before deployment:
export BOOP=test
echo $BOOP
# test
And try ,
rsconnect deploy shiny . --name myname --title your-app-name -E BOOP
This also does not work. However, if I modify my app to access the PATH
variable (which I know will exist on the server without me having to set it) I can see that variable just fine, so the issue isn't my code accessing environment variables.
Why can I not pass an environment variable using the methods described in the reconnect deploy shiny
documentation?