mirror of
https://github.com/django-components/django-components.git
synced 2025-09-10 16:06:18 +00:00
Update readme (thanks @mohammedalhaddar).
This commit is contained in:
parent
458b5383e0
commit
f87f87dadf
1 changed files with 35 additions and 2 deletions
35
README.md
35
README.md
|
@ -3,7 +3,40 @@
|
||||||
A way to create simple reusable template components in Django.
|
A way to create simple reusable template components in Django.
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
```pip install django-components``` (NOTE: Does not work yet)
|
|
||||||
|
Install the app into your environment:
|
||||||
|
|
||||||
|
> ```pip install git+https://github.com/EmilStenstrom/django-components.git#egg=django_components```
|
||||||
|
|
||||||
|
Then add the app into INSTALLED APPS in settings.py
|
||||||
|
|
||||||
|
```
|
||||||
|
INSTALLED_APPS = [
|
||||||
|
...,
|
||||||
|
"django_components",
|
||||||
|
...
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Optional
|
||||||
|
|
||||||
|
To avoid loading the app in each template using ``` {% load django_components %} ```, you can add the tag as a 'builtin' in settings.py
|
||||||
|
|
||||||
|
```
|
||||||
|
TEMPLATES = [
|
||||||
|
{
|
||||||
|
...,
|
||||||
|
'OPTIONS': {
|
||||||
|
'context_processors': [
|
||||||
|
...
|
||||||
|
],
|
||||||
|
'builtins': [
|
||||||
|
'django_components.templatetags.component_tags',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
# Create your first component
|
# Create your first component
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue