PY.CAFE Guide#

This guide demonstrates how to deploy a Panel app on PY.CAFE.

PY.CAFE is a platform for creating and sharing data apps online, powered by Pyodide. It offers a free tier for users.

1. Log In#

Visit PY.CAFE and either sign in or sign up for an account if you want to save your projects to your personal gallery.

2. Choose the Panel Framework#

Select the Panel framework from the available options or use the direct link PY.CAFE/snippet/panel.

3. Update the requirements.txt File#

Add panel and any other necessary dependencies to your requirements.txt file:

panel

You don’t have to pin version of panel or other dependencies as PY.CAFE will create a lock file with pinned versions automatically.

4. Update the app.py File#

Update your app.py file with the following code:

import panel as pn

pn.extension()


def model(n=5):
    return "⭐" * n

slider = pn.widgets.IntSlider(value=5, start=1, end=5)

interactive_model = pn.bind(model, n=slider)

layout = pn.Column(slider, interactive_model)

pn.template.FastListTemplate(
    site="Panel", title="Example", main=[layout],
).servable()

After updating the file, save it, and the app will reload instantly.

Finally you can click PUSH to persist your app and click SHARE to share it with the world.

Expert Tutorials#