Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

111
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda