I’m trying to create an app using Streamlit and it is working fine locally but when I deploy the app on a server it is not showing the sidebar navigation and getting the error:
Page not found
You have requested page /closings, but no corresponding file was found in the app’s pages/ directory. Running the app’s main page.
My file structure is the docker container > main app > pages > 1_closing.py. I’m creating tabs and here is the sample code:
I’m not sure why it says page /closings but my file path is /docker/pages/closings.
It was a typo here while posting the issue but not in the actual file name therefore this is all set.
Can you please advise what else the issue could be? I’ve spent more than three days on this, but I’ve not found a solution yet, as it works locally but not on the server.
Did you check your file name? You also have “closing” in your filename vs “closings” in the href.
If it’s not that, can you link to your repo? Some small discrepancy like this can cause this, so it’d be best to see the source.
(As far as working locally but not the server, I’d double check that everything is fully synced. After that, the most common source of error is file path handling, but you are starting a new session by routing the URL instead on using a Python command, so I don’t see the usual problem of switching between Windows and Linux paths from the bit that I can see.)
As for the “s” in pages, that was my mistake. The expected error is “… requested page /closings…” (a reference to the URL pathname, not the file path). So I’m left with only the “s” after “closing” that might be missing in one spot.
Hi @mathcatsand, I’ve resolved the issue. The issue was not about the file naming but how the files were handled in Dockerfile where instead of including just the primary file, all python files should have been included. I’ll mark this resolved. Thank you very much!
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.