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")
spin.toml
Add more html files your requirements
[component.myapp]
source = "app.wasm"
files = ["templete/index.html"]
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spin_templete-0.1.2.tar.gz.
File metadata
- Download URL: spin_templete-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8b8df89d9cdce73fa4c27415149c806120800eb00ef3ebfab12a49e82fae1da
|
|
| MD5 |
a29792e3fca0c5a693b83ef429a2184f
|
|
| BLAKE2b-256 |
f5cf617362d07a56615180ed46317ea248ce6b0fc099686da93450874c176c30
|
File details
Details for the file spin_templete-0.1.2-py3-none-any.whl.
File metadata
- Download URL: spin_templete-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73bac60dfed7fba35f5709be0fbad4305f5fe59882aa773b60cf49fcae2173f9
|
|
| MD5 |
7838131ee430416115b4b4f84485afd5
|
|
| BLAKE2b-256 |
0cd08f105e7a7eeb5ed2c25b671b23830af31019125e38683852c1657734882b
|