Forwarded from Python Daily
lona-web-org/lona - очень любопытный фреймворк, который позволяет писать веб-приложения полностью на пайтоне. Ни строчки на js впредь! 😁
#github #github_explore #nothabr #pydaily
from lona.html import HTML, Button, Div, H1
from lona import LonaApp, LonaView
app = LonaApp(__file__)
@app.route('/')
class MyView(LonaView):
def handle_request(self, request):
message = Div('Button not clicked')
button = Button('Click me!')
html = HTML(
H1('Click the button!'),
message,
button,
)
self.show(html)
# this call blocks until the button was clicked
input_event = self.await_click(button)
if input_event.node == button:
message.set_text('Button clicked')
return html
app.run(port=8080)
#github #github_explore #nothabr #pydaily
GitHub
GitHub - lona-web-org/lona: Write responsive web apps in full python
Write responsive web apps in full python. Contribute to lona-web-org/lona development by creating an account on GitHub.