Stoic HTML: A simple wrapper around Django's `format_html()`
Project description
stoic-html
What is "stoic-html"?
Stoic HTML is a tiny wrapper around the method format_html() of the Django web framework.
Since I switched to developing the frontend with htmx.org I tend to write small function-based-views returning small HTML fragments.
That's why I switched from using a template language to creating the HTML directly inside my Python code.
That's in general considered dirty, and frowned upon.
For me it is Locality of Behaviour: I have all these things together in one place. That gives me a lot of power and speed.
Install
python3 -m venv stoic-html-env
cd stoic-html-env/
. bin/activate
pip install -U pip wheel
pip install -e git+ssh://git@github.com/guettli/stoic-html.git#egg=stoic-html
cp src/stoic-html/.env.example src/stoic-html/.env
echo '. $VIRTUAL_ENV/src/stoic-html/.env' >> bin/activate
echo 'export $(cut -d= -f1 $VIRTUAL_ENV/src/stoic-html/.env)' >> bin/activate
. bin/activate
Naming convention
See: https://github.com/guettli/django-htmx-fun
Guidelines
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
stoic-html-2021.9.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for stoic_html-2021.9.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bf7ca79fd5b295cb34dae4af3e93574fd764ee2d65a256e7cbd9072d82b8d08 |
|
MD5 | 5b3f05b16af44dcba5811dac5d6baa84 |
|
BLAKE2b-256 | ecd10b14571f674d8e4ddcf63aa56804bee74c9735874bff858da9e583aed199 |