Skip to content

Commit c21a049

Browse files
committed
Fix binding in django
1 parent c1aaf07 commit c21a049

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

django/django.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"sync"
1111

1212
"github.com/flosch/pongo2"
13+
"github.com/gofiber/fiber"
1314
"github.com/gofiber/template/utils"
1415
)
1516

@@ -180,6 +181,14 @@ func getPongoBinding(binding interface{}) pongo2.Context {
180181
if binds, ok := binding.(map[string]interface{}); ok {
181182
return binds
182183
}
184+
if binds, ok := binding.(fiber.Map); ok {
185+
bind := make(pongo2.Context)
186+
for key, value := range binds {
187+
bind[key] = value
188+
}
189+
return bind
190+
}
191+
183192
return nil
184193
}
185194

0 commit comments

Comments
 (0)