1👍
✅
You can’t use the jQuery load
function to load templates from Django. Templates are not standalone HTML pages: as you already know from writing the other views, you need to write a URL and a view to render the template and return it.
What you should be doing is getting your /setting/save-reporter/
view to return the rendered template, and insert that result in your div via .html()
:
success: function(response) {
$('#authorisedreporter').html(response);
Source:stackexchange.com