Everything looks alright here, but you might be missing an argument when you render this template. Make sure that everything is being imported over there correctly. & By any chance can you share the rendered template code where the template gets rendered?