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

UPYTL: pure python templating #1418

Open
valq7711 opened this issue Apr 2, 2023 · 0 comments
Open

UPYTL: pure python templating #1418

valq7711 opened this issue Apr 2, 2023 · 0 comments

Comments

@valq7711
Copy link

valq7711 commented Apr 2, 2023

Hi! Just want to share
pip install upytl

from bottle import route, run
from upytl import UPYTL, html as h

upytl = UPYTL()

template = {
    h.Html(): {
        h.Head(): {
            h.Meta(charset='utf-8'): None
        },
        h.Body(): {
            h.Div(Class='{some_class}'):
                'Hey [[ user_name ]]! How do you do?'
        }
    }
}


@route('/hello')
@upytl.view(template)
def hello():
    return dict(some_class='super-class', user_name='Man')


run(host='localhost', port=8080, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant