1👍
✅
I suspect you’re serving the JS file separately. If that’s the case, then you’ll have to:
either write the full URL yourself in the JS file.
source: "/api/get_ticker/",
or copy the script in your HTML template.
<script>
$(function() {
$("#ticker").autocomplete({
source: "{% url 'get_ticker' %}",
minLength: 2,
});
});
</script>
0👍
Try this:
$(function(){
$('#ticker').autocomplete({
source: "{% url 'get_ticker' %}",
minLength: 2,
});
});
- [Answer]-How to get header and data from Models in Python?
- [Answer]-Django-Haystack autoquery gives strange results with solr backend
- [Answer]-Django show "It worked" page instead of my project when I start it docker
Source:stackexchange.com