Django Ajax无法正常工作

Why is my data not rendered on html plate, the function is being called, i checked, pls see my js code and html, console gives no errors

<!-- HTML -->
<div class="model" type="x-tmpl-mustache"><h1>{{model}}</h1>   </div>


// JavaScript
$(document).ready(function(){
    $.get("/portfolio/model", function(data){
        console.log(data
    $('div.model').html(data);
});


# Python view
class Return_portfolio(LoginRequiredMixin, View): 
    template_name = "dashboard.html"

    def get(self,request):
        user = request.user
        model = Portfolio()
        model_id = model.recommended_portfolio(request, user)
        print(model_id)
        if request.is_ajax():
           return JsonResponse({'model':model_id})

        return render(request, 'dashboard.html',{'portfolio_view':True})

    def post(self,request):
        return HttpResponseNotAllowed(['GET'])

Try this:

$(document).ready(function(){
    $.get("/portfolio/model", function(data){
        console.log(data);
        $('div .model').html(data);
});

Your console.log had a syntax error. Also, I changed the jQuery element id.