Skip to content

Commit 0f764bf

Browse files
1 parent b85d8df commit 0f764bf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/template/django/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,12 @@ Hello, World!<br /><br />Greetings from Fiber Team
186186

187187
When working with Pongo2 and this template engine, it's crucial to understand the specific rules for data binding. Only keys that match the following regular expression are supported: `^[a-zA-Z0-9_]+$`.
188188

189-
This means that keys with special characters or punctuation, such as `my-key` or `my.key`, are not compatible and will not be bound to the template. This is a restriction imposed by the underlying Pongo2 template engine. Please ensure your keys adhere to these rules to avoid any binding issues.
189+
This means that keys with special characters or punctuation, such as `my-key` or `my.key`, are not compatible and will not be bound to the template. This is a restriction imposed by the underlying Pongo2 template engine. Please ensure your keys adhere to these rules to avoid any binding issues.
190+
191+
If you need to access a value in the template that doesn't adhere to the key naming restrictions imposed by the Pongo2 template engine, you can bind the value to a new field when calling `fiber.Render`. Here's an example:
192+
193+
```go
194+
c.Render("index", fiber.Map{
195+
"Fiber": "Hello, World!\n\nGreetings from Fiber Team",
196+
"MyKey": c.Locals("my-key"),
197+
})

0 commit comments

Comments
 (0)