I know that I am allowed to add customized JS into django admin BUT can I just add something like <script>var a = 'b';</script>
into django admin?
Now I am using something like
meta Media:
js = ['/site_media/choice.js']
the reason I dont want to use the above is, I have a script which is like the above and the script will run differently in different admin model pages.
for example in the above choice.js
I have a function run()
in model admin A I will want this page to use run('abc')
but in model admin B I want this page to use run('eee')
if adding js instead of just typing out script, that means I will have to create quite a lot js
Can someone give me a hand of this? (currently using django 1.10.5)
Edited: Sorry my bad, I did try using the template first and few other ways but none worked