[Vuejs]-How to create users in Django's backend database when using Vue.js and Auth0 for frontend authentication

0👍

You want to make Ajax calls – I recommend Axios – to communicate between your client and server sides. It’s pretty straightforward, I’ve been using it with Vue.js & love it.

Something like:

in auth.vue:

axios.post('/yourUserRoute', {
    firstName: 'Fred',
    lastName: 'Flintstone'
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

If you make sure that you call this axios call every time you want to register a new user, your back-end will receive the correct informations for you to proceed on your server. I never touched Django so I’m not going to try and help you on the details, but this should give you a good start to work with!

Leave a comment