Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pycafe deployment guide #7183

Merged
merged 17 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/_static/logos/pycafe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions doc/how_to/deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ For guides on running and configuring a Panel server see the [server how-to guid
![Ploomber Logo](../../_static/logos/ploomber.png)
:::

:::{grid-item-card} PY.CAFE
:link: pycafe
:link-type: doc

![PY.CAFE Logo](../../_static/logos/pycafe.png)
:::

::::

## Other Cloud Providers
Expand All @@ -74,4 +81,5 @@ gcp
heroku
huggingface
ploomber
pycafe
```
63 changes: 63 additions & 0 deletions doc/how_to/deployment/pycafe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# PY.CAFE Guide

This guide demonstrates how to deploy a Panel app on [PY.CAFE](https://py.cafe/).

PY.CAFE is a platform for creating and sharing data apps online, powered by [Pyodide](https://pyodide.org/). It offers a free tier for users.

## 1. Log In

Visit [PY.CAFE](https://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](https://py.cafe/snippet/panel/v1).

## 3. Update the `requirements.txt` File

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

```bash
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:

```python
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.

<iframe src="https://py.cafe/app/MarcSkovMadsen/pycafe-reference" title="PyCafe Reference Example" frameborder="0" style="width: 100%; height: 500px;"></iframe>

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

## Example Gallery

Explore the examples below:

- [Greeting App](https://py.cafe/maartenbreddels/panel-interactive-greeting-app ).
MarcSkovMadsen marked this conversation as resolved.
Show resolved Hide resolved
- [Reference Example](https://py.cafe/MarcSkovMadsen/pycafe-reference) from the [GitHub repository](https://github.com/holoviz/panel/#interactive-data-apps).
- [Basic Dashboard](https://py.cafe/MarcSkovMadsen/basic-dashboard) from the [Basic Dashboard Tutorial](../../tutorials/basic/build_dashboard.md).
MarcSkovMadsen marked this conversation as resolved.
Show resolved Hide resolved
- [VideoStream Interface](https://py.cafe/MarcSkovMadsen/videostream) from the [VideoStream Interface Tutorial](https://panel.holoviz.org/gallery/streaming_videostream.html).
MarcSkovMadsen marked this conversation as resolved.
Show resolved Hide resolved
- [XGBoost Training](https://py.cafe/MarcSkovMadsen/xgboost-training) from the [Converting Panel Applications How-To Guide](https://panel.holoviz.org/how_to/wasm/convert.html).
MarcSkovMadsen marked this conversation as resolved.
Show resolved Hide resolved
Loading