Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Display all data in Django to external js

I've been using an id to get all data from external js but the question is I want to display data from the database, but using the template is on external js, I just call an 'id' from external js to my HTML, is somebody know how to read {for data} under external js? It is very helpful for me if someone give some idea about my problem.

views.py

def dashboard(request):
   tasks = task.objects.all()
   tasks = {'requestsdata':tasks}
   return render(request, 'dashboard.html',tasks)

dashboard.html - I've been using id to fetch all data inside external js

<div class="card-body">                   
    <div id="demo2"></div>
</div>

custom.js External js

{% for listofdata in requestsdata%}
var kanban2 = new jKanban({
element: '#demo2',
 gutter: '15px',
 click: function (el) {
   alert(el.innerHTML);
 },
 boards: [{
  'id': '_todo',
  'title': 'To Do (Item only in Working)',
  'class': 'bg-info',
  'dragTo': ['_working'],
  'item': [{
      'title': `
            <a class="kanban-box" href="#"><span class="date">24/7/20</span><span class="badge badge-info f-right">medium</span>
            <h6>{{listofdata .description}}</h6>   
            //etc. so on .........
       `,
    }
  ]
},
]
});
{% endfor %}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!