Dorian Santner - Providens Analytics GmbH.
Javascript on the frontend:
python in the backend :
Prefere JS in the Backend --> SvelteKit
() Smaxtec uses Svelte for Dashboarding
opinionated enhancements for HTML
<nav>
<a href="/pages/a">A</a>
<a href="/pages/b">B</a>
<a href="/pages/b">C</a>
</nav>
<article>
Page A
</article>
<nav>
<a href="/pages/a" up-target="article">A</a>
<a href="/pages/b" up-target="article">B</a>
<a href="/pages/b" up-target="article">C</a>
</nav>
Unpoly allows you to open page fragments in an overlay. Overlays may be stacked infinitely.
<a href="/companies/new"
up-layer="new"
up-accept-location="/companies"
up-on-accepted="up.render('.companies', { response: event.response }">
New company
</a>
other UseCase: Selection Field -> Layer to show list -> selection closes Layer and returns selected Results
pip install unpoly
def my_view(request):
if request.up: # Unpoly request
# Send an event down to unpoly
request.up.emit("test:event", {"event": "params"})
# ... and also clear the cache for certain paths
request.up.clear("/users/*")
else:
...
def form_view(request):
form = MyForm(request.GET)
# When unpoly wants to validate a form it sends
# along X-Up-Validate which contains the field
# being validated.
if form.is_valid() and not request.up.validate:
form.save()
return render(request, "template.html", {"form": form})
"A pure Python, React-style web framework Solara helps you build powerful & scalable Jupyter and web apps faster and easier." (*)
standing on the shoulders of giants ...
(*) "pure python" for the user; Its components do use CSS, JS and HTML.
import solara
clicks = solara.reactive(0)
@solara.component
def Page():
def increase_clicks():
clicks.value += 1
with solara.Div() as main:
solara.Button(label=f"Clicked {clicks} times", on_click=increase_clicks)
return main
display(Page())
# local example "plot.py"
from plot import *
Page()