I have a flask app that I converted as a streamlit app. The streamlit app works fine. With my flask app, I can replace my IP # with my computer name in the URL and it works fine. However, with my streamlit app, if I replace the my IP # with computer name or host name, my streamlit app appears to be stuck with the message of “Connecting” showing up in top right and then in the body of the page it just keeps saying “Please wait…”
I prefer to be able to use my computer/host name instead of IP # since my IP # could change. Being able to use a computer name instead of IP # in the URL, my users (internal users at my company) would be able to access my steamlit app even if my IP # changes.
Therefore, it would be great if there is a way I can use computer/host name with streamlit somehow. Is this just a matter of setting up a configuration in the config.toml file? Or is this not possible with streamlit currently?
Darn, I missed the [browser] section in the config.toml file. I was just looking at the [server] section. Apparently, I just needed to do:
[browser]
serverAddress = ‘your_computer_name’
@pybokeh what do you mean by ‘your_computer_name’? Do you mean the IP address of your local server, or something else? Is there any chance you share with me your config.toml file? I cannot seem to find it on my Ubuntu. Thanks in advance for your help.
Then in your config.toml fle, just add the lines:
[browser]
serverAddress = ‘your_computer_name’
and then the streamlit URL you can share (if they are within your network) would be:
http://your_computer_name:8501
EDIT: Per their docs, in the section “View all config options” for location of config.toml You can just create the config.toml file if it doesn’t exist.
I didn’t even consider sharing the app in the intranet using this approach and quite honestly I didn’t even know this would work but it did. I didn’t even have to update the config.toml file.
Thanks for such great insight @pybokeh.
GM
You’re welcome @gabe_maldonado ! I am researching if streamlit can be used in a company or industry setting which explains the scenarios I raise. So yes, having a intranet-aware Streamlit app would be so useful in a company setting. Wouldn’t surprise me if many people are not aware of this “trick” and perhaps unnecessarily hosted their streamlit app on a remote server and/or bothered their IT with server resources that were perhaps not needed.
Thank you @pybokeh for your help. I came across this useful page and it shows how to get the current configuration using streamlit config show and how to set it.
Depending on if company or personal laptop, but typically you would open the Windows “command prompt” and then issue the following command: ping localhost
Then you want to use the fully qualified domain name that comes after where it says “Pinging”…
Then you can use that instead of IP # which is typically dynamic, not static. Hope this helps.
Hello @pybokeh and all;
I am currently preparing a streamlit app that allows both training and inference of a model. I am looking for something that can give me the server address of the app in the python script itself. The reason behind this is that I am using streamlit as a handy interface. However, when the app is deployed, I don’t want to show the training functions, but rather only the inference. On the other hand, if the app is started locally, the training functions can show.
Can anyone help me if there is a python function to call that would return e.g “localhost” when the app will start locally and would return some URL of the deployed app when the app is indeed deployed and started from some web address?
your post helped a lot, i changed the baseUrlPath = “department_name”, and the server address to my computer name like this serverAddress = “computer_name”.
Now everyone can see it under http://computer_name:port/department_name
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.