How to render a Django Serializer Template with React Js?

I've set up my api for a basic model in my Django project. I've defined my post and get methods and everything is working correctly. Now, I'm wondering how I can render my Django model using react js. Essentially, I'm wondering how I can use react js to assign my django model values that were inserted using reactjs instead of django. For example, if my django model's fields are "name" and "id", how can I assign these fields using reactjs instead of the basic Django page(I've inserted my current page below)? Do we need to use axios or jquery to make these transitions? Thanks.

Current Django Page View

Instead of thinking how to render your django model in react, i think it is easier to understand when you think in the server-client model.

Basically you want to get you data from your django server and then show it in the client, using react.

To do this with Django rest framework, the best way is to make HTTP requests from the client to the server. You could use the browser built-in fetch api from javascript or a http library like axios.

You can read more about fetch here

Back to Top