README
django-viewcomponent is a Django library that provides a way to create reusable components for your Django project.
It is inspired by Rails ViewComponent, which built by GitHub.com
For more insights into the problem it addresses and its design philosophy, check out this video by GitHub Staff member Joel Hawksley
Use Component in Django Template
You can create components and use them in Django templates.
Use Component in Python
Or you can create components and use them in pure Python code.
Why use django-viewcomponent
Single responsibility
django-viewcomponent can help developers to build reusable components from the Django templates, and make the templates more readable and maintainable.
Testing
django-viewcomponent components are Python objects, so they can be easily tested without touching Django view and Django urls.
Documentation
FAQ
django-viewcomponent vs django-components
- django-viewcomponent is inspired by Rails ViewComponent, focusing solely on encapsulating Django templates without concerning itself with other elements such as frontend assets or generating Django responses.
- The
slotfield in django-viewcomponent can be invoked multiple times to pass collections. - In django-viewcomponent, slot fields are declared in the Python component file rather than in the template file, making the slot field more flexible and easier to maintain.
- django-viewcomponent includes a preview feature that allows developers to easily create component previews.
Metadata
Release files for django-viewcomponent 1.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_viewcomponent-1.0.11.tar.gz | 10.0 kB | Without provenance | Details for django_viewcomponent-1.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_viewcomponent-1.0.11-py3-none-any.whl | Python 3 | none | any | Details for django_viewcomponent-1.0.11-py3-none-any.whl |
Total release size: 24.1 kB
Release files / django_viewcomponent-1.0.11.tar.gz
| Download URL | django_viewcomponent-1.0.11.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21c535af2fadde494f830e38fd4807ce6ccf12f2501f83c3f62a4b43288909f2
|
|
BLAKE2b-256 checksum How to use checksums |
838a596e501a193d1897b616e4e8481bf614c7b336718a520c03ed9782efb966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / django_viewcomponent-1.0.11-py3-none-any.whl
| Download URL | django_viewcomponent-1.0.11-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa4f1bf93ab2fc153a73ae9ad73ce85fd22fd3d225bd89f9274d10e1a03934d0
|
|
BLAKE2b-256 checksum How to use checksums |
cb450d8830cdc9f097f1aa09fca21960b1b64e097d8f0275722af533aed96c62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Security for django-viewcomponent 1.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.