R
R
Ribachok2021-08-24 16:43:30
JavaScript
Ribachok, 2021-08-24 16:43:30

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

1 answer(s)
V
Vladislava, 2021-12-11
@vladis005

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 question

Ask a Question

731 491 924 answers to any question