Skip to content

axplus/lizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lizard

Reactive template rendering from Django server views.

Installation

From pip:

pip install lizard

Add codes into settings.py of your Django project:

INSTALLED_APPS = [
    ...
    'lizard',
]

MIDDLEWARE = [
    ...
    'lizard.middleware.VdomConverter',
]

Basic Usage

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')
    )

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published