Reactive template rendering from Django server views.
From pip:
pip install lizard
Add codes into settings.py of your Django project:
INSTALLED_APPS = [
...
'lizard',
]
MIDDLEWARE = [
...
'lizard.middleware.VdomConverter',
]
Hello world:
def index(request):
return Div('Hello world')
More complex:
from lizard.base import Component
class WelcomePage(Component):
def render(self):
return Div(
H1('Welcome'),
f'Hello, {self.props['yourname']}!'
)
def index(request):
return WelcomePage(
yourname=request.GET.get('yourname')
)