Skip to content

Commit 0d5df04

Browse files
committed
Update installation instructions for Jinja
1 parent 8321c4d commit 0d5df04

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@
5050
```
5151
5252
If you do not add `django.contrib.auth` to your `INSTALLED_APPS` and you define any permissions for your navigation items, `django-simple-nav` will simply ignore the permissions and render all items regardless of whether the permission check is `True` or `False.`
53+
54+
1. **Add the template function to your Jinja environment**
55+
56+
If you want to use Jinja 2 templates you will need to add the `django_simple_nav` function to your Jinja environment.
57+
Example:
58+
59+
```python
60+
from jinja2 import Environment
61+
from jinja2 import FileSystemLoader
62+
63+
from django_simple_nav.jinja2 import django_simple_nav
64+
65+
environment = Environment()
66+
environment.globals.update({"django_simple_nav": django_simple_nav})
67+
```
68+
5369
<!-- getting-started-end -->
5470
5571
## Getting Started

0 commit comments

Comments
 (0)