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

103
Views
Django API view for javascript Ajax request

Let's say I have a Chart demo

class Chart(models.Model):
    data = models.TextField()

I store and load data in format of JSON, manipulate data and tries to render a chart on frontend. User case can be:

  1. user use app interface to generate data, upload it
  2. data is uploaded to backend and stored within an Chart instance
  3. use detail view and a redirect url to illustrate the result
def chartDetailView(request, pk):
    chart = Chart.objects.get(pk=pk)
    return render(request, 'chart/chart.html', {'data': chart.data})

There are many website that allows custom JS request, for example, Web: how to redirect to a CodePen or JsFiddle with information filled?.

Since the static page only requires a data context to perform functionality, is there a way I can build an Ajax for javascript to open a new tab for the view?

I mean, to code a view which can be requested by anchor link, form, Ajax or fetch with data passed in by JS, and return a static page. (no Chart instance stored)


Sorry the question may seems ignorant to you, I have learned little about rest framework. I will be very grateful for

  1. any suggestion you make.
  2. any source to look at.
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!