Answer the question
In order to leave comments, you need to log in
How to insert js variable into django template?
There is a variable i, how to insert it into {{ book.i.title }}? Tried using with but it doesn't work.
Answer the question
In order to leave comments, you need to log in
Try to create a js file. And then add it to the template. But if book is a model, then you can hardly refer to book.i because i should then be a field of the model
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question