Navigating Multi-page app in deployment

I am trying to get a Panel dashboard production ready, and part of that was deploying onto the server. It’s a multi-page app, however instead of navigating via the index page, there are buttons on the page itself that worked on a local server between pages.

Now, when it deploys to IPADDRESS:5006/app when a button is pressed to navigate to say, page 2 as IPADDRESS:5006/page2 or even IPADDRESS:5006/app/page2 I get a 404. Any idea why this may be happening?

1 Like

Hi @robml

Could you share some more information?

  • What exactly does your command to start the panel application look like?
  • What are the file names you are serving?
1 Like

Hi @Marc so here is what I have at the bottom of my app.py file that is the main application:

page1().servable()
page2().servable()
page3().servable()

pn.serve({
    "":page1,
    "last_page":page3,
    "content_page":page2,
},static_dirs={'assets': './static/assets','thumbnails':'./static/assets/thumbnails'},
websocket_origin=['*'],port=5506,allow_websocket_origin='localhost:5006')

where page1,page2,page3 are all functions that return the appropriate page.

Consequently, I use the following command to run the server:

~$ panel serve app.py --address IPADDRESS --allow-websocket-origin=IPADDRESS:5006

where IPADDRESS is just a placeholder.

In this instance I am only serving the one file app.py but such that it has functions that each return a different page, kindly let me know if I have left something unclear.

@Marc is this issue unsolvable at the moment? Would I need to integrate with another framework?