[Vuejs]-Passing ID Mitch mech with Django Pattern in Axios, Vue JS

0👍

You can not work with a template tag to determine the URL since a template tag is resolved at the server, not at the client, and the JavaScript function runs at the client.

You thus should construct the url with:

axios({
    url: 'save_todo_update/' + id,
    # ⋮
}).then(response => {
    // console.log(response.data)
    this.getTodos()
})

-1👍

Change the url in html to:

    url: "{% url  'save_todo_update'  id %}",
               

Leave a comment