Let’s say I have a python script that takes JSON input, does some analysis, and then spits out the result. I want to be able to connect it to my frontend like this:

r/webdev - Django api to connect React frontend to local python script

Where a form on the React frontend takes the user input, then uses a django api to send it to the python script where the analysis will occur before having the data sent back and displayed.

Really, my question is how do I set up this django REST api? Normally you would import from the django.db module and it would handle everything but since I am not querying a db I’m not sure what to do.

Any help/video links/resources would be appreciated!

Source link

Write A Comment