A small package to easily create components inside your templates without saving them in the templates folder.
Project description
Django Simple Components
Django Simple Components is a small package to easily create components inside your templates without saving them in the templates folder.
Quick start
- Install package from pypi:
pip install django-simple-components
- Add
simple_components
to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...,
"simple_components",
]
- Add
simple_components
to your template like this:
{% load simple_components %}
{% set_component "first_component" %}
<div class="card">
<h3>{{ title }}</h3>
<p>{{ description }}</p>
</div>
{% end_set_component %}
<div class="card-list">
{% component "first_component" title="Hello world!" description="Some text..." %}
{% component "first_component"
title="Some lines"
description="Other text..."
%}
{% with value="this text will be capitalized later" %}
{% component "first_component" title=123 description=value|capfirst %}
{% endwith %}
</div>
- Hooray! Everything is ready to use it.
Contributing
If you would like to suggest a new feature, you can create an issue on the GitHub repository for this project. If you'd like to contribute code, you can fork the repository and submit a pull request with your changes.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
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
Built Distribution
Close
Hashes for django-simple-components-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e294540d9ee3199817e7ea01867e0e1dd34fbc9964aa98db04dcdeb35b3bc9ff |
|
MD5 | 4bc7731d4956ae585ba8df7460e908b9 |
|
BLAKE2b-256 | 8821356842d28887d55f2d0e172072b1ad7cc1707964e4ac7d1ec20e10d7ecdc |
Close
Hashes for django_simple_components-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b54bf4319819164203fa29e8f1554f994a98660d8b0960778c55254fa1fee48e |
|
MD5 | 0dea521d9ba4d866f7bb102d39f252c4 |
|
BLAKE2b-256 | 84bc4d35f7fca484c5b5c5571db278d4ce8266b4cb37a2a39b9eb4d5ba258bde |