Answer the question
In order to leave comments, you need to log in
How to pass variables from django to js?
Application in Django and Angular.
What's the common approach for passing variables? More precisely, not just variables, I'm interested in the results of url reversal and string localization. After all, they must be transferred to be used inside scripts! And I don’t want to overtake all the scripts through the template engine either, it seems to me that this is too much.
So far I'm using a crutch - a global object that is defined in the template, and then the data from it is used in scripts, but it seems ugly to me.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question