I have a python script written up that returns a list of values from a database. I want to incorporate that script into my django website that I have created. I have an html file right now in my templates folder that has dictionary values hardcoded but how do I replace the dictionary hardcoded material with the script, lets call it values.py
<script type="text/javascript">
$(document).ready(function() {
var dropDown = [" ", "Run1", "Run2", "Trail1", "Trail2"];
var dropDownID = [" ", "111111", "222222", "333333", "444444", "555555"];
$("#dropDown").select2({
data: dropDown
});
$("#dropDown").change(function() {
$("#dropdownID").val(dropDownID[$("#dropDown option:selected").index()]);
});
});