2👍
In 2021, I have come across the following projects:
I have used django-render-partial
pretty extensively, and I like that the interface allows your partials to be used in templates, or hooked directly up to a urls.py
.
django-components
looks pretty cool, because it allows you to package CSS and JS files with the use of a Media
class (similarly to Django forms), but it fractures the "everything is a view" pattern provided by django-render-partial
.
- [Django]-Django: don't cache particular view?
- [Django]-Django Gunicorn: Unable to find application
- [Django]-Celery scheduled tasks with expiration time for each task instance?
1👍
I used django_components which saved me a lot of pain, it supports creating reusable components with dynamic components name, and it also allows passing HTML fragments to the components.
- [Django]-Django 1.3 internationalization… switching language requires server restart?
- [Django]-How to call external python script in django from a dropdown button on click event in the html
- [Django]-How can I pass values/parameters from HTML to Django Views?
0👍
It was useful for me to learn about django-simple-components.
Here small example:
# file: templates/myapp/latest_news.html
{% load simple_components %}
{% set_component "article" %}
<div class="card">
<img src="{{ image }}" />
<h3>{{ title }}</h3>
<p>{{ description }}</p>
</div>
{% end_set_component %}
<div class="news-list">
{% component "article"
image="https://..."
title="Some lines"
description="Other text..."
%}
{% component "article" image="https://..." title="Second Post" description="Second description..." %}
</div>
- [Django]-How can I know if a email is sent correctly with Django/Python?
- [Django]-Django signals. how to create a unique dispatch id?
- [Django]-How to download data from azure-storage using get_blob_to_stream
- [Django]-Django migrations: how to generate database from current state of the models (good old syncdb –all)
Source:stackexchange.com