Pass information from javascript to django app and back

后端 未结 3 913
灰色年华
灰色年华 2020-12-24 03:41

So I\'m trying to basically set up a webpage where a user chooses an id, the webpage then sends the id information to python, where python uses the id to query a database, a

3条回答
  •  一整个雨季
    2020-12-24 04:25

    About how to capture info from ajax request/urls, Usually you can do that as in a normal django requests, check url dispatcher docs and read about django views from official docs.

    About how to return response, just capture the parameters, process your request then give your response with appropriate mimitype.

    Sometimes you have to serialize or convert your data to another format like json which can be processed more efficiently in a client-side/js

提交回复
热议问题