Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_neat_html-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

django_neat_html-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

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

Hashes for django_neat_html-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29cadca82d23ae72cc890202aa86d3607aaf12aa3fffbbb1232eb0283b273166
MD5 0790f4f68dae2d90d317ce42dcb4c9f0
BLAKE2b-256 f568a22348c4de1681760d443919e9afd1226a54e26f094161b84c21dc47fa23

See more details on using hashes here.

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

Hashes for django_neat_html-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1207bca5916462385a4ed483a5c8356c7d3ddb95b77988d29a88f7948b39c856
MD5 09cbd5f5b6cb42a2f28258358c6e4fc3
BLAKE2b-256 f4c900de2c39c37ae7600b19fafb0537424d2b94d5423d09c8127933ca6398cb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page