R
R
Rrooom2014-08-18 11:53:25
Django
Rrooom, 2014-08-18 11:53:25

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

1 answer(s)
T
timur14, 2014-08-28
@timur14

see also this - django.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question