How to create custom jinja functions

Good day,
Am trying to create my own jinja function but i get ModuleNotFoundError: No module named 'app.utils.jinja_methods'.

In the hooks file i add jinja = {"methods": "app.utils.jinja_methods"}
I have also created a folder in my module app app->utils->, then in the i have created a function

def function()
   //code here
return code

I went in a file called myfile.html in the www and called the jinja function but i get the Error ModuleNotFoundError: No module named 'app.utils.jinja_methods'.

{{ function() }}

Please help

its should be like this

1 Like

Thank you.