No project description provided
Project description
django-neat-html
Integrate neat-html as a template backend for Django.
Examples
Installation
Using pip:
pip install django-neat-html
Configuration
Add the django_neat_html.NeatHtml template backend.
# my_project/settings.py
TEMPLATES = [
...
{
'NAME': 'neat_html',
'BACKEND': 'django_neat_html.NeatHtml',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {},
},
]
Usage
Write some components using the neat-html package.
# my_project/my_app/neats/components.py
from neat_html import Element, h
def my_page(context) -> Element:
return h("h1", "My page")
Reference them as a template in your Django views.
# my_project/my_app/views.py
from django.template.response import TemplateResponse
def my_view(request):
return TemplateResponse(request, "my_project.my_app.neats.component.my_page", {})
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 django_neat_html-0.1.0.tar.gz.
File metadata
- Download URL: django_neat_html-0.1.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.10.13-3-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29cadca82d23ae72cc890202aa86d3607aaf12aa3fffbbb1232eb0283b273166
|
|
| MD5 |
0790f4f68dae2d90d317ce42dcb4c9f0
|
|
| BLAKE2b-256 |
f568a22348c4de1681760d443919e9afd1226a54e26f094161b84c21dc47fa23
|
File details
Details for the file django_neat_html-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_neat_html-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.10.13-3-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1207bca5916462385a4ed483a5c8356c7d3ddb95b77988d29a88f7948b39c856
|
|
| MD5 |
09cbd5f5b6cb42a2f28258358c6e4fc3
|
|
| BLAKE2b-256 |
f4c900de2c39c37ae7600b19fafb0537424d2b94d5423d09c8127933ca6398cb
|