spin templete is the layer of Spin-python-sdk for render html
Project description
What is Spin
Spin is a framework for building and running event-driven microservice applications with WebAssembly (Wasm) components.
Spin Templete
spin templete is the layer of Spin-python-sdk for render html
How to install spin_templete
pip install spin_templete
setup
mkdir templete
cd templete
touch index.html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Hello World Again Momin</h1>
<ul>
{% for item in items %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<ul>
{% for item in mylist %}
<li>{{ item }}</li>
{% endfor %}
</ul>
<h1>{{name}}</h1>
</body>
</html>
app.py
from spin_sdk.http import IncomingHandler, Request, Response
from spintemplete.templete import Render
html = Render("templete")
class IncomingHandler(IncomingHandler):
def handle_request(self, request: Request) -> Response:
return html.render("index.html",items=[1,2,3,4,5],mylist=["hello","world"],name="momin")
Check Our Site : https://mefiz.com/about
Developed by : Momin Iqbal
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
spin_templete-0.1.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for spin_templete-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89d968e5c61f4517a95c7fb2c57d590df42ac1440605f03e72f974a4a9c938f5 |
|
MD5 | 227893f05dec051c477527d5703da0ed |
|
BLAKE2b-256 | 678c9675249ef30249f2d8a4866ee43d74df16daf7c228c3f148cd9a8f1e11a6 |