#jinja2 — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #jinja2, aggregated by home.social.
-
Встречайте: muenvsubst — улучшенный envsubst
Все мы любим envsubst за простоту, но он примитивен. Переходить на Python с Jinja2 ради шаблонизации конфигов в CI/CD — всё равно что стрелять из пушки по воробьям, да и тащить рантайм ради пары переменных не хочется. В мире Go есть неплохие аналоги, но их вес в 100 МБ вгоняет в тоску, когда стремишься к минимализму в Docker-образах. Теперь всё изменилось так как появился muenvsubst — замена стандартной утилите, написанная на C++17, заточенная под хардкорную шаблонизацию в инфраструктуре. В этой статье я расскажу, как уместить мощь, близкую к Jinja2 (включая циклы, условия, макросы и вызов shell), в статический бинарник весом менее 400 КБ .
https://habr.com/ru/articles/1041580/
#шаблонизатор #c++17 #upx #jinja2
-
Just released the
askamarust crate (jinja templating)0.16.0version!It comes with a lot of nice features and increased support of
jinjafeatures.You can see the full details here: https://github.com/askama-rs/askama/releases/tag/v0.16.0
https://crates.io/crates/askama
Enjoy!
-
Just released the
askamarust crate (jinja templating)0.16.0version!It comes with a lot of nice features and increased support of
jinjafeatures.You can see the full details here: https://github.com/askama-rs/askama/releases/tag/v0.16.0
https://crates.io/crates/askama
Enjoy!
-
Vengo laburando hace 10 meses en uno de los proyectos mas complejos de mi vida profesional: #Odoofly.
#Odoofly es una herramienta que simplifica el despliegue y mantenimiento de instancias #Odoo en Local o en la nube. No quise reinventar la rueda, pero si tomé las mejores prácticas en mis años de devops y metí todo en una herramienta CLI con una curva de aprendizaje suave.
No reemplaza el laburo de un #Devops, pero si les aseguro que te abstrae de interactuar al pepe con #Docker, por cuestiones relacionados con mantenimiento Odoo(actualizar addons, crear stagings, etc.)
El código esté basado en cimientos modernos: Usé #Typer para el CLI, @pydantic
para validaciones, #Jinja2 para templates, #Rich para textos y salidas facheritas, entre otros.
Si, todo codeado en #Python✌️
¿A quienes va dirigido? implementadores, Devops y empresas de todos los tamaños que quieran simplificar y hacer su infraestructura predecible y auditable.
La licencia será AGPL-3.0. #SoftwareLibre para comunidades libres. -
Se me hacia cuesta arriba domar un tema existente, tipo blog. Con #CSS modernos puedes hacer layouts responsivos fácilmente con grid/flex. Puedes injectar los parámetros basicos para el branding del yaml al template html como variables CSS y propagar/modificar con calc y funciones de color. El resto de cosas que ofrece el generador ya estan en python: #jinja2, #markdown, #yaml, #watchdog...
-
Se me hacia cuesta arriba domar un tema existente, tipo blog. Con #CSS modernos puedes hacer layouts responsivos fácilmente con grid/flex. Puedes injectar los parámetros basicos para el branding del yaml al template html como variables CSS y propagar/modificar con calc y funciones de color. El resto de cosas que ofrece el generador ya estan en python: #jinja2, #markdown, #yaml, #watchdog...
-
Or is there something fucked up with the #Jinja2 parsing (like a bugged library or something)?
Cause I get this in another module:
Where as before it would evaluate to
"published_ports": []
instead...
-
Or is there something fucked up with the #Jinja2 parsing (like a bugged library or something)?
Cause I get this in another module:
Where as before it would evaluate to
"published_ports": []
instead...
-
Reading the Django 6.0 release notes, I really like the new Template Partials in the Django Template Language, originally started by @carlton. They strongly resonate with the Locality of Behavior design principle.
Since Django also supports Jinja2, I’m curious about convergence there too. Projects like jinja2-fragments by @sergi and jinja_partials by @mkennedy explore similar ideas.
https://docs.djangoproject.com/en/6.0/releases/6.0/
https://github.com/sponsfreixes/jinja2-fragmentsJust a thought, not a proposal 🙂
-
Reading the Django 6.0 release notes, I really like the new Template Partials in the Django Template Language, originally started by @carlton. They strongly resonate with the Locality of Behavior design principle.
Since Django also supports Jinja2, I’m curious about convergence there too. Projects like jinja2-fragments by @sergi and jinja_partials by @mkennedy explore similar ideas.
https://docs.djangoproject.com/en/6.0/releases/6.0/
https://github.com/sponsfreixes/jinja2-fragmentsJust a thought, not a proposal 🙂
-
Учусь Ansible: от пинга до Nginx на Raspberry Pi и Orange Pi
Привет. Я студент, изучаю Ansible на Raspberry Pi через Tailscale. Делюсь полным путем от первой ошибки до работающих веб-серверов. Код + выводы + уроки. Репозиторий на GitHub.
https://habr.com/ru/articles/973466/
#raspberry_pi #nginx #ansible #ansible_playbook #jinja2 #devops #linux
-
jinja2-fragments now has proper #Starlette support: https://jinja2-fragments.readthedocs.io/latest/framework_integrations.html#starlette-integration
If you are using #htmx with Starlette, this might be of interest to you :)
-
jinja2-fragments now has proper #Starlette support: https://jinja2-fragments.readthedocs.io/latest/framework_integrations.html#starlette-integration
If you are using #htmx with Starlette, this might be of interest to you :)
-
Variables are not passive. Their shape defines your power. Ghost Templates turn data into action.
https://deadswitch.tomsitcafe.com/2025/09/ghost-templates.html
-
Variables are not passive. Their shape defines your power. Ghost Templates turn data into action.
https://deadswitch.tomsitcafe.com/2025/09/ghost-templates.html
-
Logic and data separated. Elite forces of Operations - rise. #Jinja2 #Template #Ansible #IaC #DevOps #Automation
http://tomsitcafe.com/2025/09/04/05-objective-code-as-message-jinja2-templates/
-
Logic and data separated. Elite forces of Operations - rise. #Jinja2 #Template #Ansible #IaC #DevOps #Automation
http://tomsitcafe.com/2025/09/04/05-objective-code-as-message-jinja2-templates/
-
Разбираем «под капотом» кастомную фитнес-метрику: от идеи до реализации на Python
Всем привет! Я, как и многие здесь, не только разработчик, но и человек, увлеченный циклическими видами спорта. Я обожаю копаться в данных своих тренировок из Strava: анализировать мощность, пульсовые зоны, темп. Но мне всегда не хватало одной вещи — единой, понятной и, главное, прозрачной метрики, которая бы отвечала на простой вопрос: "А насколько я сейчас в хорошей форме?". В этой статье я расскажу, как устроен этот механизм "под капотом". Мы погрузимся в логику на Python, посмотрим, как она интегрируется в общий анализатор активностей и как результат подается пользователю в простом и понятном виде. Важный дисклеймер: Весь проект, от идеи до кода, я делаю один в свободное от основной работы время. Он далек от идеала , и я буду очень благодарен за конструктивную критику и свежий взгляд.
https://habr.com/ru/articles/942444/
#python #strava #petproject #анализ_данных #фитнесметрики #вебразработка #flask #jinja2 #спорт #здоровье
-
Are there any Neovim users working with 11ty? I’m having a bit of difficulty getting a Jinja2 Treesitter parser setup. Everything else is working properly (lsp, prettier, and properly reading the .njk file type.)
Just having trouble with syntax highlighting for the HTML parts in .njk files.
-
🚀 Building #CyMaIS & beyond, I made some #opensource CLI tools:
🔹 #j2render: Render #Jinja2 into #YAML for #Ansible or configs.
https://github.com/kevinveenbirkenbach/j2render🔹 #voltrace: Trace #Docker volume mounts in containers.
https://github.com/kevinveenbirkenbach/voltrace🔹 #pulseBluetoothMux: Bash script merging all #Bluetooth sinks into one #PulseAudio sink on #Manjaro #GNOME.
https://github.com/kevinveenbirkenbach/pulse-bluetooth-mux✨ Feedback welcome! #dev #linux #automation
-
Личный ИИ-ассистент на ваших данных. Часть 2: Веб-интерфейс, авторизация и стриминг ответов от ИИ
Продолжаем тему, которая вызывает живой интерес у многих разработчиков и энтузиастов ИИ — создание собственного ассистента на базе ChatGPT или DeepSeek с использованием личной базы знаний. В этой части статьи мы шаг за шагом превращаем консольную заготовку из первой части в полноценный веб-сервис: — реализуем авторизацию — создаём веб-чат с выбором нейросети — интегрируем всё через FastAPI — готовим к деплою Если вы хотите, чтобы ваш ИИ-ассистент выглядел и работал как настоящий сервис — поехали!
https://habr.com/ru/companies/amvera/articles/902868/
#векторные_базы_данных #python #deepseek #chatgpt #langchain #openapi #openapi_api #fastapi #fastapi_stream #jinja2
-
SSTI в Python под микроскопом: разбираем Python-шаблонизаторы
В статье разберем, какой импакт атакующие могут получить, используя SSTI (server-side template injection) в пяти самых популярных шаблонизаторах для Python: Jinja2, Django Templates, Mako, Chameleon, Tornado Templates. Отметим, что это не новый ресерч с rocket-science-векторами, а анализ работы уже известных PoC и разбор улучшений части из них, которая может быть полезна при тестировании. Приятного прочтения! Читать
https://habr.com/ru/companies/bizone/articles/896556/
#ssti #вебуязвимости #пентест #багбаунти #шаблонизатор #jinja2 #django_templates
-
I'm very pleased to announce that version 25.1.0 of jinjanator has been published today.
This release includes a community contribution which adds support for the '--filters', '--tests', and '--customize' CLI arguments from 'j2cli'. This should make it much easier for j2cli, and jinja2-cli, users to migrate to jinjanator.
Also, I'm gratified to see that jinjanator is being downloaded more than 250,000 times per month (which probably means it is being used in a large number of automated CI workflows)!
-
I'm very pleased to announce that version 25.1.0 of jinjanator has been published today.
This release includes a community contribution which adds support for the '--filters', '--tests', and '--customize' CLI arguments from 'j2cli'. This should make it much easier for j2cli, and jinja2-cli, users to migrate to jinjanator.
Also, I'm gratified to see that jinjanator is being downloaded more than 250,000 times per month (which probably means it is being used in a large number of automated CI workflows)!
-
Создание динамических таблиц в SuperSet
Однажды в студеную зимнюю пору из-за морей, из-за океанов прилетело известие: лицензии не выдаем, тех.поддержку не оказываем, а можем и вовсе отключить все системы. В компании погоревали, но делать нечего, решили переходить на новые системы, да такие, чтобы не смогли в любой момент их превратить в тыкву. И стали смотреть в сторону open-sourсe решений. Проанализировали несколько BI-систем и остановились на SuperSet. /*После QlikSense и Tableau казалось, что это так себе затея*/ Меня зовут Корнева Настя, я отвечаю за разработку BI-отчетности в Magnit Tech в рамках проекта Аналитика УЦП (управление цепочками поставок). В этой статье поделюсь нашим опытом создания динамических сводных таблиц в BI-инструменте SuperSet, что будет полезно разработчикам отчетности и всем, кому интересна тематика.
https://habr.com/ru/companies/magnit/articles/869924/
#superset #сводная_таблица #динамическая_таблица #jinja #jinja2 #python #big_data #bi
-
„Im Schnitt betrug die Nettokaltmiete in Spiekeroog am Stichtag 10,55 €/qm. Unter den 100 teuersten Gemeinden Deutschlands nimmt Spiekeroog damit Platz 68 ein. Bezogen auf die teuersten Gemeinden in Niedersachsen ist Spiekeroog die Nummer 2.“
-
„Im Schnitt betrug die Nettokaltmiete in Spiekeroog am Stichtag 10,55 €/qm. Unter den 100 teuersten Gemeinden Deutschlands nimmt Spiekeroog damit Platz 68 ein. Bezogen auf die teuersten Gemeinden in Niedersachsen ist Spiekeroog die Nummer 2.“
-
Automatische Textbefüllung mit #Jinja2 (Python) aus den Daten des #Zensus 2022:
„Im Schnitt betrug die Nettokaltmiete in Magdeburg am Stichtag 5,75 €/qm. Bezogen auf die teuersten Gemeinden in Sachsen-Anhalt ist Magdeburg damit die Nummer 9.“
https://www.zensus2022.de/DE/Ergebnisse-des-Zensus/_inhalt.html
-
Automatische Textbefüllung mit #Jinja2 (Python) aus den Daten des #Zensus 2022:
„Im Schnitt betrug die Nettokaltmiete in Magdeburg am Stichtag 5,75 €/qm. Bezogen auf die teuersten Gemeinden in Sachsen-Anhalt ist Magdeburg damit die Nummer 9.“
https://www.zensus2022.de/DE/Ergebnisse-des-Zensus/_inhalt.html
-
yeah, failing silently is absolutely fine!
this will never lead to problems
#homeassistant #jinja2 #template
Edit: stupid precendence-error on my part, see replies
-
-
Crear miniaturas para YouTube con Inkscape n
Crear #miniaturas para #youtube con #inkscape y #jinrender de forma automatizada utiliando #jinja2 #rust y #bash con #github actionsEscucha: https://atareao.es/podcast/crear-miniaturas-para-youtube-con-inkscape/
Feed: https://atareao.es/mp3-feed/ -
@mikaeleiman Yeah #Jinja2 is kind of the "default" template system for anything in #Python - not literally the default, but popular enough that it might as well be. It'd be a good choice for you.
-
Myslel jsem si, že z kombinace #Jinja2 a #Markdown je akorát nepořádek, zvlášť když přimíchám makra, a že ten moderní přístup, to #MDX, kdy se všechno píše jako nějaké ty frontendové komponenty a tak, že by to bylo lepší.
Teď mám pod rukama větší projekt, kde je všechno to nové: #Docusaurus, .md, .mdx, .jsx, .tsx… a teda nemám pocit, že by to byl nějaký menší bordel.
Zjevně to vždy začne „budou to jen Markdown soubory v adresáři, fakt jen pár dynamických věcí“, a skončí to jako PHP verze 3.
-
I've just published version 24.1.0 of jinjanator and its various plugin packages - this version includes a community-authored contribution of a new plugin type, "extensions".
Plugins of this type allow you to enable additional Jinja2 extensions for the template rendering process. These can be extensions provided with Jinja2 itself (but not enabled by default in jinjanator), or extensions provided by any Python package you've installed into the environment, or by the plugin package itself.
I have not created the one-liner plugins that would be needed to enable Jinja2's optional extensions, but they will be easy to create if someone wishes to do that 🙂
-
I hate working with Ansible and Jinja. Is there some set of filters that will take a list of dictionaries like this and work without making Ansible loop and do multiple transactions per host?
```yaml
- ansible.builtin.package:
name: "{{ packages | ??? }}"
state: present
become: true
vars:
packages:
- name:
- gcc
- gcc-c++
version: "13.2.1"
- name:
- libxml2
- libxml2-devel
version: "2.10.4-3"
```
#ansible #jinja2 -
As of today, PieFed includes a ‘theme engine’ which makes it easier for people with low or no Python skills to change how PieFed looks and behaves.
Let’s start with the app/templates/themes directory in the PieFed codebase. In this directory there will be a sub-directory for each theme that is available. As of this writing there is only one, called ‘high_contrast’. If you want to make a new theme, copy the high_contrast directory and rename the copy to something 20 characters or less. Let’s pretend your theme is called ‘my_theme’.
Inside ‘high_contrast’ is high_contrast.json. This file contains a bit of information about the theme, to improve the user experience of choosing which theme to enable. Currently the only information in there is a user-friendly name for our theme but I might add more in future. In our new theme we to rename high_contrast.json to be the same as the directory containing it, or ‘my_theme.json’ in this case. Also change the user friendly name in the JSON to something like “My Theme”. Take care not to change the double quotes.
Also in the theme directory are two files: styles.css and scripts.js. You can remove the high_contrast CSS and put your own. high_contrast’s scripts.js is empty and is just a placeholder to encourage you to add your own JavaScript.
In PieFed on the main menu, go to Account -> Settings and check if your new theme is shown as an option in the Theme field. If not then you messed up the naming of the theme directory or theme.json file. The theme setting here will change the theme you use while browsing PieFed – to change it for everyone go to Admin -> Misc Settings and set the ‘Default theme’ option.
Editing styles.css and scripts.js will probably be enough for most people. But in addition to that you can copy any .html file from app/templates into your theme and that copy will be used instead of the default one. For example, the home page template is app/templates/index.html so if you copied it to app/templates/themes/my_theme/index.html then any edits you make to the copy will be used to render the home page in a different way than the stock PieFed theme would!
If you want to theme a template in a sub-directory, like app/templates/post/post.html then the correct place for your copy will be app/templates/themes/my_theme/post/post.html.
The .html templates are a mixture of HTML and a language similar to Python called Jinja2.
I very much look forward to seeing what people come up with!
Licensing
PieFed is licensed under the open source AGPL license and themes are considered derivative works. As a result, themes need to be licensed under the AGPL as well.
This means that anyone who distributes or shares their PieFed themes must do so under the terms of the AGPL, ensuring that the source code of the theme remains open and accessible to others. If you do not distribute or share the theme with others then you do not need to share the source code with the public.
Using the theme to serve a publicly-accessible PieFed instance is “distribution” so you need to be able to make the theme source code available to everyone, either as a downloadable file or a git repository. If you choose to send PieFed a PR of your theme it will be gratefully accepted.
https://join.piefed.social/2024/02/07/changing-piefeds-appearance-with-themes/
-
New release of Jinja Fragments is out with support for Litestar thanks to @pythonbynight !
-
Was looking into picking up #flask again for my #python search app and in the end I did a quick course on #codecademy on it. I got a membership this year to skill up my Python with @jessicagarson but now I’m realizing there’a courses for loads of frameworks and additional stuff I want to dive deeper on! I’m loving the practice and exercise lead syllabus so far, and nice that they give you a #cheatsheet at the end. Next up going to do the #jinja2 module and then #django