# App doesn't work correctly when using pn.serve / app.show instead of panel serve

**URL:** <https://discourse.holoviz.org/t/app-doesnt-work-correctly-when-using-pn-serve-app-show-instead-of-panel-serve/8407>\
**Category:** Panel\
**Created:** [November 20, 2024, 5:56pm UTC](https://discourse.holoviz.org/t/app-doesnt-work-correctly-when-using-pn-serve-app-show-instead-of-panel-serve/8407 "2024-11-20T17:56:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![corentinlger](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/corentinlger/32/7014_2.png) [@corentinlger](https://discourse.holoviz.org/u/corentinlger)\
**Post date:** [November 20, 2024, 5:56pm UTC](https://discourse.holoviz.org/t/app-doesnt-work-correctly-when-using-pn-serve-app-show-instead-of-panel-serve/8407/1 "2024-11-20T17:56:06Z")

</div>

Hello, I am using panel to display a simulation hosted on a server. I usually run this command to start the interface:

```bash
panel serve interface.py

```

```python
#interface.py
from panel_app import WindowManager

# Serve the app to launch the interface
wm = WindowManager()
wm.app.servable(title="app_title")

```

But I would need to run this interface without using command line, so the best option seems to encapsulate it in a function to use it in other modules of my project.

I tried to run the interface like this :

```auto
python3 test.py

```

```auto
#test.py
import panel as pn
from panel_app import WindowManager

def serve_app():
    # Initialize WindowManager
    wm = WindowManager()
    pn.serve(wm.app, title="Vivarium")

if __name__ == " __main__":
    serve_app()

```

The interface starts and plot the first frame of the simulation. Then, using buttons on the interface seems to work because I can start / stop the simulation (I get this notification on my server, and I can check that the simulation state has changed), but can’t see the plot of the simulation being updated.

I tried to debug this myself and also used “wp.app.show(threaded=True)” instead of pn.serve but got the same result.

Did I do something wrong ?

I can provide more information if it is needed to solve the problem.

Thanks in advance !  
Corentin

---

<div class="post-metadata">

**Author:** ![petegordon](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/petegordon/32/5235_2.png) [@petegordon](https://discourse.holoviz.org/u/petegordon)\
**Post date:** [November 27, 2024, 10:46am UTC](https://discourse.holoviz.org/t/app-doesnt-work-correctly-when-using-pn-serve-app-show-instead-of-panel-serve/8407/2 "2024-11-27T10:46:27Z")

</div>

I’m only familiar with using pn.serve (and I do it a lot) with a dictionary that has the route at the template/app function to be called in it as the first parameter. Here is the documentation, to try other examples:  
[Serving multiple applications — Panel v1.5.4](https://panel.holoviz.org/how_to/server/multiple.html)
